How to set crontab to execute every 5 minutes - LinuxConfig.org

cron is the job scheduler in Linux systems that can execute commands or scripts at regular intervals. Each task scheduled in cron is called a cron job. The utility used for scheduling these jobs is called crontab.


This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-set-crontab-to-execute-every-5-minutes

I followed the above exactly as it is shows and it does seem to be trying to do the job as I see the creation of a new file, but it is always empty. The script works fine when I run it by itself but not while scheduled with Cron.

Also, I don’t see a terminal window pop up and show the information that is echo’d. Is there something that I can check? Could it be a permissions issue with Cron not being permitted to write in my folder (the script permissions are 555)?

Hi HarrySakk,

Welcome to our forums.

It should be indeed a file rights issue. Add execution right to the script:

$ chmod +x script.sh

And it should start working on the next scheduled run.