How do I create a cron job that will run everyday at 12:20am? How do I create a cron job that will run everyday at 12:20am? shell shell

How do I create a cron job that will run everyday at 12:20am?


The crontab for "everyday at 12:20am" is

20 0 * * *

The whole line in crontab would then be

20 0 * * * /usr/bin/ruby /Users/tamer/scripts/sftp.rb


The crontab entry should look like:

20 0 * * * /usr/bin/ruby /Users/tamer/scripts/sftp.rb

This assumes that you don't need any other environment variables to make it all work. If you do need other variables, then create an environment-setting shell script which then executes the Ruby program and script.

To submit the job, I usually use:

crontab -l > x3echo  "20 0 * * * /usr/bin/ruby /Users/tamer/scripts/sftp.rb" >> x3crontab < x3rm x3