- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: 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-06-2005 02:53 AM
тАО06-06-2005 02:53 AM
Re: Can I set a timeout to cp?
For example to create a snapshort of /u01/oradata (we will call it /u01/snaporadata), you do this:
mkdir /u01/snaporadata
mount -F vxfs -o snapof=/u01/oradata /dev/vg05/lvol1 /u01/snaporadata
That's it. The mysterious /dev/vg05/lvol1 is an otherwise unused LVOL or disk that is used as the snapshot buffer. It should be sized to about 15% or so of the original filesystem. The "snapshot" does not copy the original filesystem but is a composite of unchanged blocks from the original filesystem plus the original contents of any changed blocks (since the snapshot was started) recorded in the snapshot buffer.
To remove the snapshot all you do is unmount it.
umount /u01/snaporadata
rmdir /u01/snaporadata
Man mount_vxfs for deails. Note: Snapshots require the OnlineJFS product but no HP-UX box should be without OnlineJFS anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2005 03:12 AM
тАО06-06-2005 03:12 AM
Re: Can I set a timeout to cp?
Can you explain me better the phrase "no HP-UX box should be without OnlineJFS anyway."? I may need it to justify this purchase.
Thanks,
Eric Antunes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2005 03:35 AM
тАО06-06-2005 03:35 AM
Re: Can I set a timeout to cp?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2005 07:40 AM
тАО06-06-2005 07:40 AM
Re: Can I set a timeout to cp?
>
> exit_code = 1
> while [ $exit_code -eq 1 ]
>
cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2005 08:47 PM
тАО06-06-2005 08:47 PM
Re: Can I set a timeout to cp?
I did it with the following script:
WAIT_TIME=30
TIMEOUT=300
TIMER=0
ORIGEM=/disc1/oradata/TST
DESTINO=/
exit_code=1
cp -Rp $ORIGEM/* $DESTINO
exit_code=$?
while [ $exit_code -eq 1 ]
do
echo "waiting for backup...\n"
sleep ${WAIT_TIME}
TIMER=`expr $TIMER + ${WAIT_TIME}`
if [ $TIMER -ge $TIMEOUT ]
then
echo "\nWARNING: backup NOT EXECUTED!\n";
exit_code=8;
fi
done
echo "\nSUCCESS! Backup executed!!\n"
PS: Indira please post something since the base script is yours...
Best Regards,
Eric Antunes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2005 09:09 PM
тАО06-06-2005 09:09 PM
Re: Can I set a timeout to cp?
You are setting TIMEOUT after cp operation getting completed based upon cp command return status.
If you want to set TIMEOUT for cp operation while occuring, then you have to start it background and check TIME for not reaching more than TIMEOUT variable.
You can upgrade your check by checking connectivity with remote server (ping).
which operation you are requiring putting TIMEOUT for cp command or after completion of cp command?
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2005 10:07 PM
тАО06-06-2005 10:07 PM
Re: Can I set a timeout to cp?
You are right!
I added this:
...
backup_started=0
while [ $exit_code -eq 1 ]
do
if [ $backup_started -eq 0 ]
then
backup_started=1
echo "\nStarting copy..."
cp -Rp $SOURCE_DIR/* $DESTINATION_DIR
exit_code=$?
fi
...
And I'm checking the results...
Best Regards,
Eric Antunes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2005 10:25 PM
тАО06-06-2005 10:25 PM
Re: Can I set a timeout to cp?
#!/bin/ksh
WAIT_TIME=5
TIMEOUT=300
TIMER=0
ORIGEM=/disc1/oradata/TST
DESTINO=/
exit_code=1
FLAG=0
while [ $exit_code -eq 1 & $FLAG -eq 1 ]
do
echo "waiting for backup...\n"
sleep ${WAIT_TIME}
TIMER=`expr $TIMER + ${WAIT_TIME}`
cp -Rp $ORIGEM/* $DESTINO
exit_code=$?
if [[ $? -eq 0 ]]
then
let FLAG=1
fi
if [ $TIMER -ge $TIMEOUT ]
then
echo "\nWARNING: backup NOT EXECUTED!\n";
exit_code=8;
let FLAG=1
fi
done
echo "\nSUCCESS! Backup executed!!\n"
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2005 10:28 PM
тАО06-06-2005 10:28 PM
Re: Can I set a timeout to cp?
while [ $exit_code -eq 1 && $FLAG -eq 1 ]
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2005 11:57 PM
тАО06-06-2005 11:57 PM
Re: Can I set a timeout to cp?
Maybe, starting cp in background mode:
cp -R $SOURCE_DIR/* $DESTINATION_DIR &
But I still need to check if cp ended ok before TIMEOUT!! How can I pass the return code of a command started in background mode??
Thanks,
Eric Antunes