Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have moved (mv) a pretty large directory on my NAS (Linux based), but had to interrupt the procedure. Not being a regular Linux user, I though I could just continue and merge the rest later in.

mv /oldisk/a /newdisk

Procedure is alfway done, so rest of /oldisk/a still exists, and /newdisk/a with the already copied files is already present. I have no idea which files have been already copied. BTW, under /oldisk/a, of course, are plenty of sub directories.

What would be the best way to move / merge the remaining files to /newdisk/a ?

share|improve this question

1 Answer 1

up vote 17 down vote accepted

rsync -va -n /oldisk/a/ /newdisk/a/

The -n will do a dry run, showing you what it would do without actually doing anything.

If it looks ok, run the rsync without the -n option.

This will be a copy, not a move, which isn't quite what you're doing, but is safer.

share|improve this answer
1  
Copy is OK, can always remove the old directory later. –  Horst Walter Jun 1 '12 at 16:02
    
You can use --remove-source-files to delete the files that have been successfully copied. Also, -P or --progress will show an estimate of how many more files there are to do. –  deltab May 5 at 2:43

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.