Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Vilmos Soti <vilmos@xxxxxxx>
- Date: 30 Aug 2006 12:47:03 -0700
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.
Vilmos
.
- Follow-Ups:
- Re: Scheduling Jobs - Last day of the month - HOWTO?
- From: Robert M. Riches Jr.
- 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
- 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
|