1752407 Members
5662 Online
108788 Solutions
New Discussion юеВ

Re: crontab entry

 
Sreer
Valued Contributor

crontab entry

Hello exprts,

I need to make a crontab entry for the below manner.

the reboot of server have to be planned on last Sunday of the month at 1:00 AM

how can it be? me bit confused....

00 01 * * 0 ==> I guess this may not work....

pls advice me whether the above mentioned way will work or not?

Thanks and regards
Sree
6 REPLIES 6
Hakki Aydin Ucar
Honored Contributor

Re: crontab entry

you need to warning broadcast message for event OR you want crontab to make reboot desired date ?
Vidhya B
Frequent Advisor

Re: crontab entry

Hi,
I think it will work for all the sundays in the month.

It will be better if you mention the last seven dates of the month in the third field. But the problem will arise because each month has different number of days.

I think if you schedule thrice as below it will work as far as my knowledge.
00 01 25,26,27,28,29,30,31 Jan,Mar,May,Jul,Aug,Oct,Dec 0

Similarly it will be necessary to do for the month with 30 days and feb.

But I think there might be any other simple method to do this.
Ismail Azad
Esteemed Contributor

Re: crontab entry

Hi,

It's been ages since I have used cron. Your syntax looks fine to me... And I assume you know what command or redirection you would put after the numericals.

Crontab manual " If both month and day of month are specified as an asterisk, but day of week is an element or list, then only the specified days of the week match ".

Regards
Ismail Azad
Read, read and read... Then read again until you read "between the lines".....
Sreer
Valued Contributor

Re: crontab entry

Hi Hakki Aydin,

My requirement is only to reboot the server in the mentioned time.
No need for Broadcaste message.

thnx&rgds
Sree
Manix
Honored Contributor

Re: crontab entry

Dennis Handly
Acclaimed Contributor

Re: crontab entry

Basically crontab can't directly do what you want. The closest you can do is to pick every Sunday and use the scripting ideas in Manix's threads and have them select the proper Sunday.