Is there an easy way to move a large number of files around in Linux when you expect the move to be interrupted? The 'mv' command is proving itself pretty damn worthless at the moment.
My problem is I'm running glusterfs on a single machine to cluster all it's disks together as one big drive. This is not seamless, but my problem is the cluster is very very full as it is - so I can't copy files around and then delete them (unless I use a network computer as a temp drive). But, gluster will also periodically throw an error if it starts trying to move say, a DVD image to a drive with only 2gb of free space left.
What I need, is something that will work like the 'mv' command and just rename the files, but which will let me merge large directory trees with it (i.e. Movies has an identical file structure to glusters "Movies" - lots of individual folders but not all containing files. I want the command to fill the directories in the destination that are empty with files from the source that are in directories with the same name).
Is there a command in linux to do this? I refuse to believe there isn't but damned if I can find it. I'm running Debian 'etch' incidentally.
It's somewhat counterintuitive, but would rsync (or something else along those lines) be more what you're looking for? Since it's designed for copying over networks, it's built to deal with stopping/restarting, but it'll work for copying on local filesystems as well.
Edit: beat'd. That's what I get for looking at manpages before posting. ;-)
Well in the end I just deleted what I copied and restarted the job from my local network, but next time I might try rsync. I've also sub'd to the developers list since it seems someone finally reported the issue I keep having with gluster (double creating my files and thus denying access to them until I go in and manually delete one copy).
Posts
http://www.gluster.org/mailing-list.php
You could also use this little bash script:
I think that will move directories as well as files.
Edit: beat'd. That's what I get for looking at manpages before posting. ;-)