- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- About copy file
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
05-16-2004 03:23 PM
05-16-2004 03:23 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2004 03:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2004 03:35 PM
05-16-2004 03:35 PM
Re: About copy file
how about putting both the commands in the same job???
with best wishes
Naveej
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2004 03:39 PM
05-16-2004 03:39 PM
Re: About copy file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2004 03:41 PM
05-16-2004 03:41 PM
Re: About copy file
check for the file size in second job, if the file size hasn't increased in last 20 seconds, it is probably done being copied
have first job creates a file once the rcp is finished saying it is done, second job doesn't copy file till rcp done file exists.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2004 04:10 PM
05-16-2004 04:10 PM
Re: About copy file
thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2004 04:11 PM
05-16-2004 04:11 PM
Re: About copy file
simple resolution. you make lock file.
example:
---rcp.sh---
touch /tmp/during_rcp
rcp foo bar
rm /tmp/during_rcp
---
---mv.sh---
while [ -f /tmp/during_rcp ]
do
sleep 300
done
mv bar baz
---
or:
use lockf(2) ( see man page lockf ).
or:
chmod -r ...
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2004 04:42 PM
05-16-2004 04:42 PM
Re: About copy file
Something like script1 and script2 starts with ..
************
while [ -f /var/tmp/SPR_REMOTE_CP ]
do
echo Lock file present >> $LOGFILE
sleep 60
done
touch /var/tmp/SPR_REMOTE_CP #Taken exclusive access
rcp or mv bla bla ........ #Do the task
rm /var/tmp/SPR_REMOTE # Removes the lock
Regds,
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2004 04:48 PM
05-16-2004 04:48 PM
Re: About copy file
What i think is before using mv command check for the existing of the file first and if it exists then only try moving it. See if this works for you.
while true
do
if [ -f /tmp/filename ]
then
mv /tmp/filename /anotherdir
exit
else
sleep 10
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2004 04:53 PM
05-16-2004 04:53 PM
Re: About copy file
I have used "true" and "exit" that may not be suitable in your script so modify accordingly to your requirement.
This is just an example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2004 10:38 PM
05-16-2004 10:38 PM
Re: About copy file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2004 01:12 AM
05-18-2004 01:12 AM