Created
May 5, 2016 16:31
-
-
Save pythoninthegrass/236338807da6adf6d122eecf7eeaab33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Mount the drive | |
sudo mkdir /Volumes/ClientLogs | |
mount_afp "afp://172.20.1.8/ClientLogs" /Volumes/ClientLogs | |
# Send zip file | |
dateformat=`date +"%Y-%m-%d"` | |
hostname=`jamf getComputerName | sed -e 's/<computer_name>//' -e 's/<\/\computer_name>//'` | |
user=`ls -l /dev/console | cut -d " " -f 4` | |
filename="$dateformat-$hostname.zip" | |
zip -r /Volumes/ClientLogs/$filename /var/log/ /Library/Logs/ /Users/$user/Library/Logs | |
umount -f /Volumes/ClientLogs | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment