GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script wanted
Operating System - HP-UX
1851051
Members
2949
Online
104056
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
03-22-2004 06:59 PM
03-22-2004 06:59 PM
I want to have a script to do the following task.
1. rcp the files that are within 7 days from local host ( eg. /tmp ) to the same path at other hosts ( total ten hosts ) .
2. check the above rcp whether success , if any files that are not succssfully do the rcp , redo the rcp until it is success.
could help to make the draft for it , very thx.
1. rcp the files that are within 7 days from local host ( eg. /tmp ) to the same path at other hosts ( total ten hosts ) .
2. check the above rcp whether success , if any files that are not succssfully do the rcp , redo the rcp until it is success.
could help to make the draft for it , very thx.
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2004 08:45 PM
03-22-2004 08:45 PM
Solution
Have not tested hence check it before making it online
It is better to investigate the left files than trying to copty again !!
#
if [ $# -lt 2 ]
then
echo "Syntax $0: directory node1 node2 ...."
exit 8
fi
DIR=$1
shift
if [ ! -d $DIR ]
then
echo $DIR not a directory
exit 8
fi
function check_error {
if [ $? -ne 0 ]
then
echo Could not copy $FILE onto $NODE
fi
}
for FILE in `find $DIR -mtime 7 -print |sed `
do
for NODE in $*
do
rcp $FILE $NODE:$FILE
check_error
done
done
regds,
Kap
It is better to investigate the left files than trying to copty again !!
#
if [ $# -lt 2 ]
then
echo "Syntax $0: directory node1 node2 ...."
exit 8
fi
DIR=$1
shift
if [ ! -d $DIR ]
then
echo $DIR not a directory
exit 8
fi
function check_error {
if [ $? -ne 0 ]
then
echo Could not copy $FILE onto $NODE
fi
}
for FILE in `find $DIR -mtime 7 -print |sed `
do
for NODE in $*
do
rcp $FILE $NODE:$FILE
check_error
done
done
regds,
Kap
Nothing is impossible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 04:33 AM
03-23-2004 04:33 AM
Re: script wanted
are you setting a time/date stamp in the file name somehow?
such as cp filename filename`date+%m%d%y` ?
such as cp filename filename`date+%m%d%y` ?
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP