How to automatically create a cron task with shell commands without interaction
#Write out the current crontab
crontab -l > mycron
#Write the new cron to the cron file
echo "00 09 * * 1-5 echo hello" >> mycron
#Install the new cron file
crontab mycron
rm mycron
#Restart cron:
service cron restart

Leave a Reply