Tag Archives: crontab

install new #crontab from #bash script

you need to:

  1. save the current cron jobs for the user
  2. create a file with the new job description (pun intended)
  3. insert the new configuration
  4. check the new conf

1.
crontab -l > /tmp/current_cron
or, even better. append directly to your cron conf
crontab -l >> cronconf.txt

2.
the file should look like
cat cronconf.txt
*/1 * * * * /bin/ls >> /tmp/ls
*/1 * * * * /bin/touch /tmp/me

3.
Insert the new conf by calling crontab
crontab cronconf.txt

4.
check the new conf with
crontab -l