Created
August 19, 2011 13:53
-
-
Save takamii/1156844 to your computer and use it in GitHub Desktop.
現在日時をファイル名につけてsyslogを圧縮バックアップ。gzipが必要。
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 | |
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