Where is your magazine located?
:
$ cd /log
, :
$ ls -la cron_log.log
, :
$ touch cron_log.log
( !)
$ chmod +rw cron_log.log
?
, , , :
$ /bin/bash -l -c 'echo "hello" >> /log/cron_log.log 2>&1'
, :
wrong: command 'echo "hello"'
right: command '/bin/echo "hello"'
:
$ which echo
, cron , :
$ sudo grep CRON /var/log/syslog
grep , - :
Jan 1 12:00:00 example.com CRON[123]: (root) CMD (... your command here ...)
Mac?
syslog Mac, Mac OSX cron launchd.
. cron plist (/System/Library/LaunchDaemons/com.vix.cron.plist) stdout/stderr cron. , plist, , . (. cron )
Rails?
Rails, ( cron.log)
set :output, "log/cron.log"
:
set :output, '/abc/def/ghi/log/cron.log'
, wiki :
https://github.com/javan/whenever/wiki/Output-redirection-aka-logging-your-cron-jobs
:
every 3.hours do
runner "MyModel.some_process", :output => 'cron.log'
rake "my:rake:task", :output => {:error => 'error.log', :standard => 'cron.log'}
command "/usr/bin/cmd"
end