Hi, This is from the Unix Tip of the Day from Unix.ugu:
RUN ON LAST SUNDAY If you want a job to run on the last Sunday of every month, you can use the following syntax from within cron: 18 * * * 0 [`date "+%d"` -gt 24] && /path/to/script i.e. on sundays at 18:00 check if the day of the month is greater than 24 - if so run the job (if 23 is specified the job will run on the last 2 sundays of the month) NOTE: There back-ticks around the date command, not single quotes. This tip generously supported by: [EMAIL PROTECTED] This is for using cron - but could be adapted to almost anything. Jane %%%%%%%%%%%%%%%%%%%%%% Jane Bamberger IS Department Bassett Healthcare 607-547-4750 ----- Original Message ----- From: "Talafous, John G." <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 19, 2002 9:59 AM Subject: Re: last sunday of the month > We take an extra monthly backup of our exchange servers. The last Saturday > of each month. We do it with this schedule: > > tsm: FSPHNSM1>q sched server exch_monthly f=d > > Policy Domain Name: SERVER > Schedule Name: EXCH_MONTHLY > Description: Exchange Monthly backup > Action: Command > Options: > Objects: c:\Progra~1\Tivoli\TSM\MSExc\exchmnth.cmd > Priority: 3 > Start Date/Time: 07/25/2001 13:00:00 > Duration: 7 Day(s) > Period: 1 Month(s) > Day of Week: Saturday > Expiration: > Last Update by (administrator): TALAFOUS > Last Update Date/Time: 07/19/2001 09:01:04 > Managing profile: > > It seems to work fine with one exception. That is for months that contain > less than 31 days and the last day occurs before Saturday. In that case, > the backup will be on the first Saturday of the next month. But, it's a > start! Substitute Sunday for Saturday and let me know if you find an > improvement. > > John G. Talafous IS Technical Principal > The Timken Company Global Software Support > P.O. Box 6927 Data Management > 1835 Dueber Ave. S.W. Phone: (330)-471-3390 > Canton, Ohio USA 44706-0927 Fax : (330)-471-4034 > [EMAIL PROTECTED] http://www.timken.com > > -----Original Message----- > From: Burak Demircan [mailto:[EMAIL PROTECTED]] > Sent: Monday, August 19, 2002 5:03 AM > To: [EMAIL PROTECTED] > Subject: last sunday of the month > > > How do you achieve to create a schedule for every last sunday of the month? > (there could be 4 or 5 sundays??) > Regards, > Burak > > > ********************************************************************** > This message and any attachments are intended for the > individual or entity named above. If you are not the intended > recipient, please do not forward, copy, print, use or disclose this > communication to others; also please notify the sender by > replying to this message, and then delete it from your system. > > The Timken Company > ********************************************************************** >