Just to confirm, your cron schedule 44 12 * * *
means you want to run the cron every day at 44 minutes past noon, local time of the server.
Here’s a good link for building cron schedules:
Cron Schedule Builder
Some things I would check:
Is the cron daemon running on the server?
Check Cron Deamon Status
Look for the running process using ps -ef | grep crond
. If it is running, you’ll see it in the listed processes
[my_server~]$ps -ef | grep crond
root 1699 1 0 2022 ? 00:01:28 /usr/sbin/crond -n
[my_server~]$
Is the server time correct. Maybe it is running, but not at the time you think it is.
Check Server Time
Your cron says it will run 44 minutes after noon, local time to the server.
Use the date
command to validate the time on the server.
[my_server~]$date
Tue Feb 13 14:45:37 EST 2024
[my_server~]$
Are their errors when you run your command manually.
Run Manually and Look For Errors
Simply copy your entire cron command, excluding the schedule 44 12 * * *
, and paste it into the CLI terminal.
See if there are any errors or helpful information displayed.
Write all STDOUT and STDERR to a log file and look for errors there.
Write all output to log
Instead of dumping all output to null with >/dev/null 2>&1
, create a log file to contain your cron results and dump all logs there.
Then, you can check that log to see if it ever executed and if it had any errors during execution.
0 0 * * * /bin/bash /path/to/my/script.sh &>> /path/to/log/file.txt