星期三, 7月 27, 2011

add a job to crontab with shell script

reference from:
http://ubuntuforums.org/showpost.php?p=3822718&postcount=6

Correct:
sudo sh -c "echo $min $hr \* \* \* root /home/$USER/Cron/some_file.sh >> /etc/crontab"

Wrong:
sudo sh -c echo "$min $hr * * * root /home/$USER/Cron/some_file.sh" >> /etc/crontab

沒有留言: