This is the command I want to run:
00 03 * * * backup.sh
I understand that this will run the script backup.sh at 3am every morning. How can I add this cron command on my linux server using a bash script?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As root:
echo "00 03 * * * root backup.sh" >>/etc/crontabor
echo "00 03 * * * root backup.sh" >/etc/cron.d/mybackupjobAs your own user:
crontab -l >tmp; echo "00 03 * * * backup.sh" >>tmp; crontab tmp; rm tmp