Issue
I need to add a cron job thru a script I run to set up a server. I am currently using Ubuntu. I can use crontab -e
but that will open an editor to edit the current crontab. I want to do this programmatically.
Is it possible to do so?
Solution
Cron jobs usually are stored in a per-user file under /var/spool/cron
The simplest thing for you to do is probably just create a text file with the job configured, then copy it to the cron spool folder and make sure it has the right permissions (600).
Answered By - Jason Stelzer