- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Can I set a timeout to cp?
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
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
тАО06-07-2005 12:13 AM
тАО06-07-2005 12:13 AM
Re: Can I set a timeout to cp?
cp -R $SOURCE_DIR/* $DESTINATION_DIR > /disc2/.../cp.log
2>&1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2005 04:31 AM
тАО06-07-2005 04:31 AM
Re: Can I set a timeout to cp?
> down(actual situation), it stops at the cp instruction.
that's exactly why you need to first ping the nfs server && then kick-off the copy.
ping
The purpose here is that the entire command line works or fails as a unit. Only iff the ping succeeds does the copy kickoff and if the ping fails the copy never gets executed.
see script attached...
enjoy!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2005 08:49 AM
тАО06-07-2005 08:49 AM
Re: Can I set a timeout to cp?
If this were me I would do something like this:
df -F nfs /desiredmountpoint
If that returns a zero status then you can assume that NFS is available. Of course, you need a timeout mechanism for this as well.
This would be my approach:
TDIR=${TMPDIR:-/var/tmp}
timeoutcmd.pl -t 20 "df -F nfs /desiredmountpoint" > /dev/null 2>/dev/null
STAT=${?}
if [[ ${STAT} -eq 0 ]] # df ok
then
timeoutcmd.pl -t 5400 "cp -p file1 file2 /desiredmountpoint" > /dev/null 2>/dev/null
STAT=${?}
if [[ ${STAT} -ne 0 ]]
then
echo "Cp failed; status ${STAT}" >&2
fi
else
echo "NFS unavailable; status ${STAT}" >&2
fi
exit ${STAT}
Note: This is not the same Perl script posted earlier:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2005 09:59 PM
тАО06-07-2005 09:59 PM
Re: Can I set a timeout to cp?
I'm testing your perl script now. Is there any good manual about perl?
Hi Sandman,
The problem is that the command "ping
Best Regards,
Eric Antunes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2005 11:29 PM
тАО06-07-2005 11:29 PM
Re: Can I set a timeout to cp?
With the NFS server down I get "NFS unavailable; status 127".
With the NFS server up, I still get "NFS unavailable; status 127"...
Thanks,
Eric Antunes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2005 11:31 PM
тАО06-07-2005 11:31 PM
Re: Can I set a timeout to cp?
From the command line, I get:
interpreter "/usr/bin/perl" not found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2005 11:34 PM
тАО06-07-2005 11:34 PM
Re: Can I set a timeout to cp?
find / -name "perl"
which perl
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2005 11:35 PM
тАО06-07-2005 11:35 PM
Re: Can I set a timeout to cp?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2005 11:40 PM
тАО06-07-2005 11:40 PM
Re: Can I set a timeout to cp?
ping
ping
if [[ $? -eq 0 ]]
then
action;
else
echo 'server failed'
fi
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2005 11:42 PM
тАО06-07-2005 11:42 PM
Re: Can I set a timeout to cp?
"NFS unavailable; status 255"