Cron log file

ARUN Posted in CRON, LOG FILES
0

Cpanel server

tail -100 /var/log/cron

To view cron of a user

ARUN Posted in CRON
0

crontab -u UN -l

Prevent cron job from sending out the mail

ARUN Posted in CRON
0

To prevent the sending of errors and output, add any one of the following at the end of the line for each cron job to redirect output to /dev/null.

>/dev/null 2>&1.
or

&> /dev/null

* 1 * * * /path/script.sh >/dev/null 2>&1

Send mail when cron fails

ARUN Posted in CRON
0

$ crontab -e

At the top of the file, enter:

MAILTO=”[email protected]

View the various cron jobs running in the server

ARUN Posted in CRON, LINUX COMMANDS
0

cd /var/spool/cron/

There will be a file with username which has all the crons for that user.

tail -f /var/log/cron

crontab -u Un -l   —> List cron jobs of user UN.  Should be logged in as root to view this.

crontab -l   –> List cron jobs of the user logged in

crontab -e  –>  Edit cron jobs of the user logged in.