- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script not to run on Saturday and Sunday
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
04-17-2003 01:44 AM
04-17-2003 01:44 AM
Script not to run on Saturday and Sunday
I want to put on the beginning on a script a "if - then" cicle that check if the day is Saturday or Sunday. If it's true the stop the script.
Can you help me please?
Regards...
PSS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 01:49 AM
04-17-2003 01:49 AM
Re: Script not to run on Saturday and Sunday
echo "It is a holiday... laze around..."
exit 1
fi
HTH.
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 01:52 AM
04-17-2003 01:52 AM
Re: Script not to run on Saturday and Sunday
if [ $m = "Wed" -o $m = "Fri" ]
then
echo holiday
else
echo working
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 01:59 AM
04-17-2003 01:59 AM
Re: Script not to run on Saturday and Sunday
if [ $m = "Sat" -o $m = "Sun" ]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 02:07 AM
04-17-2003 02:07 AM
Re: Script not to run on Saturday and Sunday
Why not use cron (crontab):
0 0 * * 1,2,3,4,5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 02:40 AM
04-17-2003 02:40 AM
Re: Script not to run on Saturday and Sunday
Here is a snippet of code that I use in a script which only ejects a DDS tape during the weekday after a tar backup:
#
# Eject the DDS tapes on weekdays
#
let TODAY=$(date +%u)
if ((TODAY < 6))
then
mt offl
fi
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 03:35 AM
04-17-2003 03:35 AM
Re: Script not to run on Saturday and Sunday
if [ $date = Saturday ] || [ $date = Sunday ]
then
exit 1
fi
#rest of your script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 03:37 AM
04-17-2003 03:37 AM
Re: Script not to run on Saturday and Sunday
that should be $day rather than $date, eh!
In any case, is PSS looking here at all????
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 03:37 AM
04-17-2003 03:37 AM
Re: Script not to run on Saturday and Sunday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 04:01 AM
04-17-2003 04:01 AM
Re: Script not to run on Saturday and Sunday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 04:02 AM
04-17-2003 04:02 AM
Re: Script not to run on Saturday and Sunday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2003 04:15 AM
04-17-2003 04:15 AM
Re: Script not to run on Saturday and Sunday
Just like Leif mentioned, I will use crontab.
Regards,
DR