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?
If edited file /var/spool/cron/crontabs/root via console linux (nano, mc) - restart NOT needed. If edited cron via crontab -e - restart NOT needed.
cron jobs run while the computer is on & not sleeping, so it will run in situations 1 and 2. If the computer is off or asleep at the job's scheduled time, it does not do any sort of catch-up run later when the computer restarts/wakes up; therefore, it will not run in situation 3.
*/30 * * * * your_command. this means "run when the minute of each hour is evenly divisible by 30" (would run at: 1:30, 2:00, 2:30, 3:00, etc)
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With