Cronlog for a user

Aar

Verified User
Joined
Feb 10, 2005
Messages
209
Location
Netherlands
Hello,

is is possible to have a cronlog for an user? So that de user can see if the cron hassen been runned?
I know that cron can mail the user with the output and if it succeeded, but what if the mail didn't sent?


This log should be can accessed e.g in the CMD_USER_STATS?domain=domain.com, in the list where you can find the other logs.

Is this an idea for a next update in Direct Admin?
 
Last edited:
Hello,

is is possible to have a cronlog for an user? So that de user can see if the cron hassen been runned?
I know that cron can mail the user with the output and if it succeeded, but what if the mail didn't sent?


This log should be can accessed e.g in the CMD_USER_STATS?domain=domain.com, in the list where you can find the other logs.

Is this an idea for a next update in Direct Admin?

It is already possible by redirecting the cronjobs output to a file. Say you want to run the backup script and you have a crondefinition like:
0 6 * * * /home/user/bin/backup
you can change it to:
0 6 * * * /home/user/bin/backup >> /home/user/domains/mydomain/public_html/backup.txt
Cron will extend the backup.txt file each time a backup runs. The file will be created if it does not exist.

One note of caution by the way, the script will not output anything to cron because it is been redirected to a logfile. So cron doesn't have anything to put in a mail so it doesn't send any at all. Although it isn't that hard to make cron to send you an email on each run or only at the failed runs.
 
Back
Top