Why is my cron job not running on my computer?

Why is my cron job not running on my computer?

The usual causes for cron jobs to not run are permissions and paths. Please read the cron man entry a few times and try to understand how paths break and what permissions the cron job will run under.

Why is my shell script not running with cron?

If running reboot directly as a non-root user works when you’re logged in, it’s because your system is configured to allow users who are physically logged in to reboot the system. This works via Polkit. From a crontab, you aren’t in a logged-in session. A cron job that reboots the system would have to run as root.

What to do if Bash is not running via crontab?

To make sure it is, run the following command: Do crontab -e for whichever crontab you’re using and replace it with output of the above command. This should mirror most of your environment in case there is some missing path issue or something else. Also check logs for any errors it’s getting.

How to re-enable standard output in cronjob?

Re-enable the standard output or standard error message output by removing >/dev/null 2>&1 altogether; or perhaps redirect to a file in a location where you have write access: >>cron.out 2>&1 will append standard output and standard error to cron.out in the invoking user’s home directory.

Why does Cron script not execute as expected from crontab?

Another reason can be – not specifying the absolute path of the commands used in the script. When the script is run manually the environment variable such as PATH can be different than when running from the cron. So it is always recommended to include the absolute paths of the commands used in the script.

Why does PPPD not work when running from cron?

Through our discussion in comments we confirmed that the script itself works, but pppd doesn’t, when running from cron. This is because something must be different in an interactive shell like your terminal window, and in cron. This kind of problem is very common by the way.