The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Moving files in Linux?

electricitylikesmeelectricitylikesme Registered User regular
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.

electricitylikesme on

Posts

  • DeathPrawnDeathPrawn Registered User regular
    edited June 2008
    Sounds like this could be accomplished fairly simply using a clever shell script.

    DeathPrawn on
    Signature not found.
  • Zilla360Zilla360 21st Century. |She/Her| Trans* Woman In Aviators Firing A Bazooka. ⚛️Registered User regular
    edited June 2008
    I'd ask the developers in this instance:
    http://www.gluster.org/mailing-list.php

    Zilla360 on
  • bashbash Registered User regular
    edited June 2008
    rsync?
    % rsync -a source/directory/ destination/directory/
    

    You could also use this little bash script:
    for x in sourcedir/*
    do
       mv $x destdir/
    done
    

    I think that will move directories as well as files.

    bash on
    comi-sig1.jpg
  • seasleepyseasleepy Registered User regular
    edited June 2008
    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. ;-)

    seasleepy on
    Steam | Nintendo: seasleepy | PSN: seasleepy1
  • edited June 2008
    This content has been removed.

Sign In or Register to comment.