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
Forums
Discussions
Discussions
Discussions
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
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
06-15-2004 07:08 PM
06-15-2004 07:08 PM
cron job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 07:16 PM
06-15-2004 07:16 PM
Re: cron job
Cron will do it apart from the public holiday bit. Unfortunately, cron doesn't know about public holidays. One solution, as shown above, would be to create a file containing the dates of public holidays and only run your script if a grep of todays date fails.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 07:21 PM
06-15-2004 07:21 PM
Re: cron job
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 07:23 PM
06-15-2004 07:23 PM
Re: cron job
There is no option to specify the holiday. Except excluding the date in first * postion and mentioning the day of the week in the 2nd last postion.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 07:25 PM
06-15-2004 07:25 PM
Re: cron job
00 18 * * 1,2,3,4,5 /Job_name
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 08:29 PM
06-15-2004 08:29 PM
Re: cron job
can u give me the the format of "file_of_holidays".
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 08:39 PM
06-15-2004 08:39 PM
Re: cron job
However, as an example, change the cron entry to this.
01 18 * * 1,2,3,4,5 grep `date +"%d.%m.%y"` file_of_holidays >> /dev/null || my_command
And then put dates in your file_of_holidays like this
16.06.04
02.17.04
etc etc etc. I have assummed a UK date format here because I live in Norway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 09:03 PM
06-15-2004 09:03 PM
Re: cron job
crontab don't know about the holiday's. Create a file to know the holiday with the format mm/dd/yyyy as
#--- /var/tmp/holiday ---
10/15/04
22/08/04
Set the crontab settings as
# mins hours m-day month weekday command
0 18 * * 1-5 grep `date "+%x"` /var/tmp/holiday >/dev/null | command
Regards,
Muthukumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 09:42 PM
06-15-2004 09:42 PM
Re: cron job
To include following format should work:
grep `date "+%x"` holiday_list | date "+%Ow"
assuming the date format in holiday_list as 06/16/04.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2004 12:56 AM
06-17-2004 12:56 AM
Re: cron job
If you want to put a specific schedule into the program itself instead in the crontab file?
Well here's the code snippet......
# Have a $x1_listofdates in this program that gives a schedule.
# 2. Run the cronjob every day from 1st to 10th of the month.
# 3. Have the job exit out unless the day matches the schedule.
#
# note: typeset -i tells unix the value is an integer, not octal binary.
#------------------------------------------------------------------------------
typeset -i x1_day_of_month=`date +"%d"`
x1_month_of_year=`date +"%b"`
typeset -i x1_year=`date +"%Y"`
x1_datestring=`printf "%02d%s%4d\n" $x1_day_of_month $x1_month_of_year $x1_year`
#---SCHEDULE---o---SCHEDULE---o
x1_listofdates="
02Jun2004
02Jul2004
03Aug2004
02Dec2004
"
x1_FLAGRUN=0
echo "Run the job today?"
for x1_D in $x1_listofdates
do
echo " today is $x1_datestring look at $x1_D from the list. "
if [ "$x1_D" = "$x1_datestring" ] ; then
x1_FLAGRUN=1
fi
done
if [ $x1_FLAGRUN != 1 ] ; then
echo "do not run job today"
exit
else
echo "Run job today"
fi
In this code, I have the job only run on selected days. But you could easily reverse it. Note the "typeset -i" when I got to day "08", the code though it was octal, and wanted to be "10". The -i lets it know it is an integer, not octal.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2004 12:59 AM
06-17-2004 12:59 AM
Re: cron job
Did you ever think that maybe you could kinda assign points to tell folks if the help is useful or not? I see you assigned points to 0 our of your 39 questions.
None of the answers were useful?