Question

i want to set a cronjob in directadmin control panel and i have a question. if i set a job in this format:

05 21 * * * /home/backup.sh

my script will run only one time in a day at 21:05 OR every 5 miutes(12 times in an hour) and every day at 21:00 ?? i want to my cronjobs run's only one time in a day at 21:05! please help me

Was it helpful?

Solution

Your script will run at 21:50 every day.

See the file formats manpage for crontab:

$ man 5 crontab

The line parts before the command for your crontab are: (Below is from the manpage.)

The time and date fields are:

  field          allowed values
  -----          --------------
  minute         0-59
  hour           0-23
  day of month   1-31
  month          1-12 (or names, see below)
  day of week    0-7 (0 or 7 is Sun, or use names)

A field may be an asterisk (*), which always stands for "first-last".

And you will see this example even further below: (Below is also from the manpage.)

# run five minutes after midnight, every day
5 0 * * *       $HOME/bin/daily.job >> $HOME/tmp/out 2>&1

man is your friend.

OTHER TIPS

As per the cronjob set by you the first * means minutes, second * means Hour, third * means month, fourth * means day of the month and last * means day of the week. So if you set by 5 21 * * * it would run the job at 9:05pm minutes only.

For more about cronjob check http://www.thesitewizard.com/general/set-cron-job.shtml

Thanks & Regards,
Alok Thaker

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top