cron entry

Hi,

I have to add two cron entry now. Please correct me if anything wrong

Below script should run at every one and half hour.

30 01 * * * /export/home/gxadm/scripts/collect_mq_info.pl $HOME/GCSS/logs > /dev/null 2>&1

Below script should run at every 2 hours

0 02 * * * /export/home/gxadm/scripts/copylog.sh > /dev/null 2>&1

Please help me !!

This would run the script once a day at 01:30 am. If you want to run the script every 90 minutes, you need two entries in the crontab, like:

0 0,3,6,9,12,15,18,21 * * * /export/....
30 1,4,7,10,13,16,19,22 * * * /export/....

(assuming you want every 90 minutes starting at midnight).

Same here. To run this script every two hours you need:

0 0,2,4,6,8,10,12,14,16,18,20,22 * * * /export/...

Note: Solaris' cron does not support the slash notation, like

0 */2 * * * /export/...

Oh thank, Please help
I want to run at every 30 minutes in this script :

30,60 * * * * /export/home/gxadm/scripts/collect_mq_info.pl $HOME/GCSS/logs > /dev/null 2>&1

Below script at every 45 minutes

45,90 * * * * /export/home/gxadm/scripts/copylog.sh > /dev/null 2>&1

Please give advice how to make entry !! Please

Every 30 minutes would be:

0,30 * * * * ....

Every 45 minutes would need 3 lines:

0,45 0,3,6,9,12,15,18,21 * * * ....
30 1,4,7,10,13,16,19,22 * * * ....
15 2,5,8,11,14,17,20,23 * * * ...

Note, that the first field in the crontab helds the minutes on the clock, not an interval.

Oh Thank you so much . finally I have entered like this

30 minutes : 30 1,4,7,10,13,16,19,22 * * * script
45 minutes :  0,45 0,3,6,9,12,15,18,21 * * * script

Thank you .

Mani

Crontab Tutorial (Cron Tutorial) - Online Training and Tutorials

Thank you

This means, that you start your script at
01:30, 04:30, 07:30, etc. in the first case and at
00:00, 00:45, 03:00, 03:45, etc. in the second case.
I guess that is not your intention.

Oh my god ! so I have to go like this ,

30,60,90....1440 * * * * script
45,90,135 ...etc * * * * script 

If you have exact syntax please help me

Thanks,
Mani

No!

The first field holds minutes on the clock and the second field hours. So the entry

0,30 0,3,6 * * *

means, that the job is run at every time on the clock which is a combination of 0 or 3 or 6 hours and 0 or 30 minutes, which is 00:00, 00:30, 03:00; 03:30, 06:00 and 06:30.