I have a deployment script and in it I'm trying to add a cron job. This is the code I am using which I found on stackoverflow. I'm running debian 8.
# ADD CRON
crontab -l > mycron
echo "10 * * * * cd /var/www/test/ && ./test" >> mycron
crontab mycron
rm mycron
When I run these commands I get the reply: no crontab for root
What am I doing wrong here, and how can I get it so I can add this cron job using a bash script? Thank you.
rootin/etc/cron.deny. – ott-- Apr 30 '15 at 20:50cron.d cron.daily cron.hourly cron.monthly crontab cron.weekly– Jimmy Apr 30 '15 at 21:00#!/bin/bashheader – Jimmy Apr 30 '15 at 21:13/etc/cron.dis easier to maintain. – HBruijn May 04 '15 at 04:34