UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3266 - January 18, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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: duncan.ferguson@egg.com
--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today
==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.
Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================
Tidak ada komentar:
Posting Komentar