January 6, 200917 yr mc does a great job of moving files from A to B and keeping folder structure/merging.alerting of dupes. Does anyone know a way to do this from the normal command line ? i.e. acommand /mnt/disk1/TV/B/ /mnt/disk2/TV/B/ that ensures no data from disk 2 is lost
January 6, 200917 yr I've used the -i option, but there is also the -b backup option. Usage: mv [OPTION]... [-T] SOURCE DEST or: mv [OPTION]... SOURCE... DIRECTORY or: mv [OPTION]... -t DIRECTORY SOURCE... Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY. Mandatory arguments to long options are mandatory for short options too. --backup[=CONTROL] make a backup of each existing destination file -b like --backup but does not accept an argument -f, --force do not prompt before overwriting -i, --interactive prompt before overwrite --strip-trailing-slashes remove any trailing slashes from each SOURCE argument -S, --suffix=SUFFIX override the usual backup suffix -t, --target-directory=DIRECTORY move all SOURCE arguments into DIRECTORY -T, --no-target-directory treat DEST as a normal file -u, --update move only when the SOURCE file is newer than the destination file or when the destination file is missing -v, --verbose explain what is being done --help display this help and exit --version output version information and exit The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values: none, off never make backups (even if --backup is given) numbered, t make numbered backups existing, nil numbered if numbered backups exist, simple otherwise simple, never always make simple backups
January 6, 200917 yr Author Think i must be missing something as the shell bawlks at me: root@TOWER[TV] 05:57 PM>mv -i /mnt/disk1/test/ /mnt/disk9/ mv: overwrite `/mnt/disk9/test'? y mv: inter-device move failed: `/mnt/disk1/test/' to `/mnt/disk9/test'; unable to remove target: Is a directory root@TOWER[TV] 05:58 PM>mv -i /mnt/disk1/test/ /mnt/disk9/ mv: overwrite `/mnt/disk9/test'? n and nothing actually happens lol
January 6, 200917 yr try mv -i /mnt/disk1/test/* /mnt/disk9/test/ I think the destination directory must exist in this case.
January 6, 200917 yr Author That made a big difference with all files in the main folder moved however as soon as there subfolders with data that exist on the destination it fails again: root@TOWER[TV] 06:05 PM>mv -i /mnt/disk1/test/* /mnt/disk9/test/ mv: overwrite `/mnt/disk9/test/New Folder'? y mv: inter-device move failed: `/mnt/disk1/test/New Folder' to `/mnt/disk9/test/New Folder'; unable to remove target: Is a directory thoughts?
January 6, 200917 yr I didn't know that mv works across drives. How about: cp -r -p -i /mnt/disk1/test /mnt/disk9 rm -R /mnt/disk1/test -i is the interactive part as you requested. Regards Harald
Archived
This topic is now archived and is closed to further replies.