Need to vaidate SCP move
Hey,
I am new to Linux and I am developing my first script. Yay for me that the copy works, however i need to write some logic into it to "validate the files i moved are on both the source and destination, BEFORE i remove the files from the source" Any help would be appreciated find /source -mtime +3 -type f | grep file.log |xargs -i scp '{}' DestinationServer:/destination location 2>/dev/null echo $? |
I'd look into rsync which will do a lot of the heavy lifting for you. It's extremely clever at determining which files need to be transferred from the source to the destination.
|
Quote:
Add a line into your script, to do something like: Code:
ssh user@remote.host "md5sum <filename>" |
All times are GMT -5. The time now is 03:05 AM. |