Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: "Robert M. Riches Jr." <spamtrap42@xxxxxxxxxxx>
- Date: Wed, 30 Aug 2006 21:07:29 GMT
On 2006-08-30, Vilmos Soti <vilmos@xxxxxxx> wrote:
Michael B. Johnson <mjohnson@xxxxxxxxxxx> writes:
On Wed, 30 Aug 2006 12:07:20 -0400, "Chris F.A. Johnson"
<cfajohnson@xxxxxxxxx> wrote:
0 0 31 1,3,5,7,8,10,12 * /path/to/script
0 0 30 9,4,6,11 * /path/to/script
0 0 28,29 2 * /path/to/wrapperscript
In the wrapperscript, called only in February, check whether the
current year is a leap year:
Actually this is fairly easy:
Just do something like this on February 28:
date --date=tomorrow | grep -q " Mar "
Even more, here is a way to check if this is the last day of the month:
(not checked)
month=$(date +'%h')
if ! date --date=tomorrow | grep -q " $month "; then
echo last day of the month
fi
Ensure that there is no collision with the month names anywhere.
Or, how about comparing the output of the command
date -date=tomorrow +%d
against the string "01"? Today is the last day of the month
iff tomorrow day-of-month is 1.
--
Robert Riches
spamtrap42@xxxxxxxxxxx
(Yes, that is one of my email addresses.)
.
- Follow-Ups:
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Vilmos Soti
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- References:
- Scheduling Jobs - Last day of the month - HOWTO?
- From: Michael B . Johnson
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Chris F.A. Johnson
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Michael B . Johnson
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Vilmos Soti
- Scheduling Jobs - Last day of the month - HOWTO?
- Prev by Date: Re: Scheduling Jobs - Last day of the month - HOWTO?
- Next by Date: Re: Scheduling Jobs - Last day of the month - HOWTO?
- Previous by thread: Re: Scheduling Jobs - Last day of the month - HOWTO?
- Next by thread: Re: Scheduling Jobs - Last day of the month - HOWTO?
- Index(es):
Relevant Pages
|