Re: Move Command Feature (original) (raw)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Pádraig Brady
Subject: Re: Move Command Feature
Date: Fri, 05 Apr 2013 19:55:32 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 04/05/2013 06:23 PM, Michael Boldischar wrote:

Hello,

This is a suggestion for a new feature in the "mv" command. This feature applies to moving directories. If a user moves a directory with a lot of files and encounters an error, it can often leave the source directory in a partially moved state. It makes it hard to redo the operation because the source directory has changed.

The feature I'm looking for is a flag in the "mv" command that preserves a copy of the source directory until the entire tree has been successfully copied to the destination directory. At that point, the move command can delete the source directory. That way, a user can fix the error and rerun the same move command. It makes it easier and less of a headache.

There might be other ways to accomplish this. But, I would use this feature all the time if it were available. I call it the "safe move operation."

safe move, sounds like copy and remove. mv does this on a file by file basis. To do this for a whole tree you could just:

cp -a old/ new/ && rm -Rf old/

cp -u might be useful in this situation also, but rsync is more general than cp -u/

thanks, Pádraig.