One of our client was facing issue while running the cron job, on checking the following error finds in his cron job log file /var/log/cron.log:
Jan 01 11:59:01 server cron[7510]: Error: bad username; while reading /etc/cron.d/backups
He has the job entry as follows to run at 00:50 every day for root user:
50 0 * * * /etc/cron.d/backups
He was getting this error because he forgot to set name of the user to run a cron job:
1 2 3 4 5 USERNAME /path/to/command arg1 arg2
The correct syntax will be as follows for root user to run a cron job at 00:50 every day:
50 0 * * * root /etc/cron.d/backups
To run as cppl user:
50 0 * * * cppl /etc/cron.d/backups
That’s all we have to do. You also like to know how to Install WordPress On Apache Based Centos Server. Check that and also give your opinion below if you experience any issues or to discuss your ideas and experiences.