Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How can I move files from one place to other with validation/md5 done to origin and destination? Is there some tool or sequence of commands you can script to do this?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

rsync

tutorials : http://everythinglinux.org/rsync/

for example, i use

rsync -rptDuv --exclude ~/.ssh $SOURCEDIR -e ssh -t $USER@$BACKUPSERVER:/$TARGETDIR

for backing up whole $SOURCEDIR trough ssh to some server. But there is much more options, you can read

man rsync

for them.

about moving, you can use option --remove-source-files or just delete files after copy

share|improve this answer
    
can you expand this? - the OP wants to move files not synchronise files. –  fossfreedom Jun 29 '11 at 22:11
    
sure, i will... –  Denwerko Jun 29 '11 at 22:13
1  
Just thought I'd add that files aren't really "moved". If you move a file within a filesystem, then only the link to the file is changed, while the file itself remains unchanged. In that case, there is no need to check the file for changes. If you "move" it to another filesystem, then the file is first copied and then deleted, so a synchronization is a good solution. –  Jo-Erlend Schinstad Jun 29 '11 at 22:43
    
Yes, I'm moving files from hard disk, to a USB Disk, and want to make sure they are correctly moved. Thank you! –  Luis Lobo Borobia Jul 1 '11 at 13:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.