Search code examples
linuxcron

Adding a cron job without crontab


Is it possible to add a cronjob without using the crontab command? (Or anything else except editing files directly.) Is there a file I need to edit?


Solution

  • You can directly edit the following files:

    /etc/crontab
    /etc/cron.d/*
    /etc/cron.{hourly,daily,weekly,monthly}/*
    

    These are system-wide files. In these files you must specify a username before the command to be executed.

    In contrast, per-user crontabs are stored here: /var/spool/cron/<username>