Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

easy one about RCP and a log file 1

Status
Not open for further replies.

ratbs75

IS-IT--Management
Mar 8, 2001
147
BE
Hi, I use following command (under ux10.20):

rcp -r /SourceDir root@DestServer:/DestDir

My question is following: What do I need to add to this cmd-line to get a file created with all 'transfered' file/dir-names? (like a log file) - It's not of any importance where this file would be located, it's just important to be created at the time of the copy...

Thnx in advance,

Regards,
 
no, I tried that already, the file is created, but remains EMPTY :(

But all files where correctly copied...
 
Can't see a way to do it within rcp, but if you put the names of the file in a file called, say, filenames, this script will work:

for x in `cat filenames`
do
rcp $x <hostname>:$x
if [ $? = 0 ]
then
echo $x&quot; successfully transfered at &quot;`date` >> logfile
else
echo $x&quot; failed to transfer at &quot;`date` >> logfile
fi
done

Not sure if this suits your requirements, but it's an option. Cheers.
 
oh my god :)

Ok, looks in fact interrestening anyway, I'll try that another day :)

Thnx alot for your help, that way I learned new stuff anyway, always a pleasure :)

Thnk you

Regards,

BS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top