Padraig and Assaf,

A copy and remove is how I do it right now (using the verbose option to see
exit codes).  I try to keep it simple because the data I move is so
important.  Also, I get a little nervous writing scripts using the
recursive remove command.

Rsync is definitely an option.  It's a really big hammer for moving a
directory on a local computer.  I'll have to work on increasing my comfort
level with it.

For what it's worth, I still think a safe move flag in "mv" adds value.
 Everyone's had that experience where they're learning Linux and something
bad happens during a move operation.  The safe move option makes it easier
to recover from an error when the "mv" command is chosen as the tool for
the job.  All users want the ability to undo a mistake.  My two cents.

Mike

On Fri, Apr 5, 2013 at 1:55 PM, Pádraig Brady <[email protected]> wrote:

> 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.
>
>
>


-- 
*
*
*Michael Boldischar*
Research Fellow / IT Manager
University of Minnesota
Department of Civil Engineering

MAST Laboratory
University of Minnesota
2525 4th Street SE
Minneapolis, MN 55455

Desk Phone: 612-626-9562
Cellphone: 651-387-0223
Fax: 612-624-5964
Email: [email protected]

Reply via email to