- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Cron job to run 1st Saturday of each month
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 01:45 AM
тАО03-22-2006 01:45 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 02:06 AM
тАО03-22-2006 02:06 AM
Re: Cron job to run 1st Saturday of each month
cron can't do it.
Date hammer can calculate the date in a cron script.
http://www.hpux.ws/merijn/caldj.sh
http://www.hpux.ws/merijn/caldj.pl
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 02:08 AM
тАО03-22-2006 02:08 AM
Re: Cron job to run 1st Saturday of each month
Here's one approach: Create a cron entry that will run at your chosen time every Saturday, then:
#!/usr/bin/sh
export PATH=${PATH}:/usr/local/bin
typeset -i STAT=0
if [[ $(caljd.sh -N) -eq 1 ]]
then
echo "It's the 1st Saturday; do your thing"
# execute your command and set ${STAT}
fi
exit ${STAT}
This assumes that you have installed the attached caljd.sh in /usr/local/bin. Invoke as caljd.sh -u for full usage and many examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 02:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 03:03 PM
тАО03-22-2006 03:03 PM
Re: Cron job to run 1st Saturday of each month
also consider using the following as template for your crontab:
#*******************************************************************************
# min|hour |day |month|day |script
# | |of mo| |of wk|
#----|-----|-----|-----|-----|--------------------------------------------------
#*******************************************************************************
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 04:00 PM
тАО03-22-2006 04:00 PM
Re: Cron job to run 1st Saturday of each month
minute hour monthday month weekday command
to run on 1st saturday then,
In command script>
if [[ "$(date +'%a')" != "Sat" ]]
then
exit 0
else
fi
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 08:20 PM
тАО03-22-2006 08:20 PM
Re: Cron job to run 1st Saturday of each month
# minute hour monthday month weekday (0=Sunday) command
# 0-59 0-23 1-31 1-12 0-6
* * 1-7 * 6
This will run your script on Saturday only during days from 1 to 7 of the month.
i.e.: first Saturday of teh month
(environment: HP-UX 11i)
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2006 01:21 AM
тАО03-23-2006 01:21 AM
Re: Cron job to run 1st Saturday of each month
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2006 01:26 AM
тАО03-23-2006 01:26 AM
Re: Cron job to run 1st Saturday of each month
You can find these docs for more information,
http://docs.hp.com/en/B2355-60127/crontab.1.html
http://www.adminschoice.com/docs/crontab.htm
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2006 02:07 AM
тАО03-23-2006 02:07 AM
Re: Cron job to run 1st Saturday of each month
# minute hour monthday month weekday (0=Sunday) command
# 0-59 0-23 1-31 1-12 0-6
* * 1-7 * 6
Dates specified as both days of the month and days of the week are logical OR's not
logical AND's.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2006 02:12 AM
тАО03-23-2006 02:12 AM