Skip to content

Instantly share code, notes, and snippets.

@takamii
Created August 19, 2011 13:53
Show Gist options
  • Save takamii/1156844 to your computer and use it in GitHub Desktop.
Save takamii/1156844 to your computer and use it in GitHub Desktop.
現在日時をファイル名につけてsyslogを圧縮バックアップ。gzipが必要。
#!/bin/sh
DATETIME="`date +%Y%m%d_%H%M`"
launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
mv /var/log/syslog /var/log/syslog_$DATETIME
touch /var/log/syslog
launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist
gzip /var/log/syslog_$DATETIME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment