Skip to content

Instantly share code, notes, and snippets.

@francois-blanchard
Last active December 10, 2015 10:18
Show Gist options
  • Save francois-blanchard/f16813eac34ff91852b6 to your computer and use it in GitHub Desktop.
Save francois-blanchard/f16813eac34ff91852b6 to your computer and use it in GitHub Desktop.
View log with crontab tasks

View log with crontab tasks

# 1. Open crontab
$ crontab -e

# 2. Add output log file
30 03 * * * /bin/bash -l -c 'backup perform -t my_backup' >> ~/crontab/backuplog

# 3. Open log file
tail -f ~/crontab/backuplog
@LolWalid
Copy link

Whenever

When using whenever you can redirect your output when defining your task like follow:

  every 3.hours do
    rake "my:rake:task", :output => {:error => 'error.log', :standard => 'cron.log'}
  end 
Look here for more information:

https://github.com/javan/whenever/wiki/Output-redirection-aka-logging-your-cron-jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment