Add 10 minute cron to Ubuntu package

I need to install some cron jobs with the Ubuntu installation package. Those that work every day or hour are easy: I can create a symlink from /etc/cron.daily to my script.

However, I also have a script that I would like to run every 10 minutes. There is no such thing as /etc/cron.minutely . Also I am not sure how to edit crontab without using the interactive editor ( crontab -e ). What is the best way to do this?

+8
linux cron ubuntu debian crontab
source share
1 answer

Your package can simply put the file in /etc/cron.d/

The text file should contain something like this, to run the command every 10 minutes:

 */10 * * * * root /path/to/command 

Google 'cron format' for more information, and yes, this applies to askubuntu or superuser.

Correction: after testing, I found that you need to add the username (root) to the string. This seems to be necessary for the files in cron.d, but I cannot find the final document.

cron should automatically select this new job.

+14
source share

All Articles