can I see a log of what the crontab actually did?
I put some backup procedures in the crontab. Is there a log somewhere of whether the crontab actually executed them? It would make me feel better if I could see proof at least once and know it didn't go wrong.
|
A web search turned up lots of confusing stuff about cron logs, but, if MX does not have a /var/log/cron file, my best guess is to check /var/log/syslog. (I have a VM of MX, but I'm not running any cron jobs on it.)
This might help: https://www.cyberciti.biz/faq/how-to...-ubuntu-linux/ |
By default, crontab will send email to the user's account(user@localhost) every time a cron job runs. For this to properly occur, you need to have some MTA(message or mail transfer agent) installed to send the email. The two most common are Postfix and Sendmail. If you install Postfix just go with the defaults and crontab should be able to send email. To read crontab's email messages, install mutt, a command line email reader. Note, neither mutt nor Postfix are usually installed by default.
Now for reading your crontab messages, just open a terminal and run: Code:
$ mutt Code:
$ sudo mutt Code:
q:Quit d:Del u:Undel s:Save m:Mail r:Reply g:Group ?:Help Code:
i:Exit -:PrevPg <Space>:NextPg v:View Attachm. d:Del r:Reply j:Next ?:Help |
Quote:
Code:
MAILTO=your-email-addr@your-hostname An alternate method of receiving that email notification (and I lean toward this one) is to pipe the output of the backup script into mailx (or similar) Code:
00 02 * * * run_backups 2>&1 | mailx -s "BACKUP Results" user-who-monitors-backups@your-hostname Code:
00 02 * * * run_backups 2>&1 | mailx -s "BACKUP Results" backup_admins@your-hostname HTH... |
All times are GMT -5. The time now is 02:08 AM. |