Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
Created May 5, 2016 16:31
Show Gist options
  • Save pythoninthegrass/236338807da6adf6d122eecf7eeaab33 to your computer and use it in GitHub Desktop.
Save pythoninthegrass/236338807da6adf6d122eecf7eeaab33 to your computer and use it in GitHub Desktop.
#!/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