linuxだと普通にログ取られてるのにMacは無効だったので有効化します。
#手順
/etc/syslog.conf
に以下を追記
/etc/syslog.conf
cron.* /var/log/cron.log
/System/Library/LaunchDaemons/com.vix.cron.plist
修正
-
ProgramArguments
に-x
とmisc
を追加 -
StandardErrorPath
を追加
/System/Library/LaunchDaemons/com.vix.cron.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.vix.cron</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/cron</string>
<string>-x</string>
<string>misc</string>
</array>
<key>KeepAlive</key>
<dict>
<key>PathState</key>
<dict>
<key>/etc/crontab</key>
<true/>
</dict>
</dict>
<key>QueueDirectories</key>
<array>
<string>/usr/lib/cron/tabs</string>
</array>
<key>EnableTransactions</key>
<true/>
<key>StandardErrorPath</key>
<string>/var/log/cron.log</string>
</dict>
</plist>
有効化
有効化
$ sudo launchctl
Password:
launchd% unload /System/Library/LaunchDaemons/com.vix.cron.plist
launchd% load /System/Library/LaunchDaemons/com.vix.cron.plist
#参考
http://superuser.com/questions/134864/log-of-cron-actions-on-os-x