[jump to content][No Software Patents]Tools (new) : mvatom [ Home | Scylla+Charybdis old home | Tools (old) | Tools (new) | FAQ | Downloads ]

Moving to GitHub, slowly

The software on this pages will slowly be moved to GitHub https://github.com/hilbix/. The CVS repository will be migrated to GIT as well, so the history will be preserved, a bit. See FAQ.

Scylla and Charybdis, mvatom - Tools

The tools are developed under Linux with ESR's paradigm release early, release often in mind.
So you can consider this beta software, or alpha, or pre-alpha, or even worse ;)

Have a look in the download directory for all downloads.
As always here, all you get is the source. No binaries here.

mvatom 0.4.4-20110825-142933

Move files by atomic rename instead of copy.


⇒ ⇒ ⇒ The development shifted to another location. All future versions will be published at https://github.com/hilbix/mvatom   ⇐ ⇐ ⇐


Post-modern mv implementations re-invented a wheel which is no more round. If they cannot move they do a copy/unlink() operation which is unsatisfying, as when the unlink() fails you stay with the copy which was insanely done.

mv shall be an atomic operation. However you cannot switch mv into atomic mode. This version here does what mv is supposed to do:

It renames the target and fails if it cannot do the rename (but beware the common NFS bug in such a situation). In unsafe mode it does this using the rename() operation (note that rename() has a possible race condition which may overwrite a destination unconditionally, if it is created after mvatom has checked the presence of the destination), in safe mode (will be introduced in 0.5.0) it will use hardlink/unlink. The move is "atomically" in respect to the destination either is there completely or missing, it is not "atomically" in the sense of "man 2 rename". If you need this, you need option -uf.

Another thing is that it only guesses something for the last argument like mv does if it is instructed to do so. So it always works reliably. You know what it does from looking at the command line, and if no heuristics are given this does not depend from the last arg beeing a directory or not.

If the destination is a directory this must be given as an option to mvatom. Also all options are simple and clear and there is no way to overwrite files, as mvatom never overwrites files (but beware the race condition in unsafe mode which was used before 0.5.0).

Also you can "move away" files with mvatom, too. This is done with the "backup" feature, where an existing destination can be renamed.

There now is a helper script:

cmpanddel.sh
deletes everything from a first directory which has an indentical match in a second directory. It shall be safe even against the weirdest situations where you simply cannot detect that the first directory in fact is the second one, thus accidentally deleting a whole directory tree. The protection is done by renaming the source first with mvatom. It is not race condition free, so it is thought for all those lazy experienced sysadmins out there who exactly know what they are doing.

The helper "dirlist" now is in a separate package. Example use:

dirlist -0p DIRa | mvatom -0dDIRb -

History:

version 0.4.4-20110825-142933

download (261923 bytes) sig

Nothing changed in mvatom, but dirlist now is a separate package.

This can be considered a bugfix, though, as previously 'dirlist -rp .' did not work correctly.

If you wonder where version 0.5.0 is: It is not there for the moment. So mvatom still operates in unsafe mode! Please keep that in mind.

version 0.4.3-20090409-200703

download (241196 bytes) sig

dirlist now has options -r to recurse subdirectories.

version 0.4.2-20081016-214847

download (229998 bytes) sig

dirlist now has options -a -d -l -m -u -o, and accepts more than one directory

With options -a -l -m -u you can set which types of files are output with dirlist. However this needs an additional stat() call per file.

With option -d you can debug this new feature.

With option -o you can terminate dirlist after the first successful argument. The idea is, if you have a list of possibilities, the first one wins.

version 0.4.1-20080528-164909

download (222669 bytes) sig

Option -c added

WARNING: This version still operates in unsafe mode! The description is already updated to upcomming version 0.5.0, which fixes a possible race condition (however I am still working on this fix).

With option -c you can define a directory where the backups are created instead of the target directory. It must be on the same filesystem as source and destination.

version 0.4.0-20080521-200002

download (216597 bytes) sig

Option -a added, "move away feature" fixed and renamed to option -ab, dirlist now has some options

Option -a has less race conditions than option -b. However the latest moved file then does not keep it's original name if an elder file with same name exists.

The "move away feature" had a bug in conjunction with option -s. This bug has been fixed.

The "move away feature" now needs both options -a and -b present to work. If these options are else used together, this is an error.

Dirlist now knows about a couple of options.

version 0.3.1-20080507-171312

download (213407 bytes) sig

dirlist added

Dirlist is a little program to create a directory listing. It is similar to "find", butwithout call to stat(). This way it is faster for modern FS like ZFS-FUSE.

version 0.3.0-20080504-062900

download (212518 bytes) sig

Option -s added

Option -s adds a literal prefix (this is without a /) to the source path. It only does this on the fly when accessing the source file, so it has no effect on -p etc. options.

This new option is mainly for use with option -l, for example see "dirlist" http://permalink.de/tino/dirlist which only outputs names, not pathes. This way you can add the missing path again without complex "cd" constructs.

version 0.2.5-20080426-160909

download (211942 bytes) sig

Cosmetic change

If the destination exists and option -b is not used, the output has been corrected to be more meaningful.

version 0.2.3-20071213-091901

download (207668 bytes) sig

Bugfix release and script cmpanddel.sh added

There was a long standing bug in option -p due to a bug in my library. Previously only one level of missing upstream directories were created. However there was no other bad sideffect.

The new script cmpanddel.sh is nearly untested. It is an old script now changed to use mvatom. Those changes have not been tested much yet, the basic method is proven to work.

version 0.2.2-20061021-040047

download (139475 bytes)

Newer version of tinolib to compile under Ubuntu 64 bit systems.

version 0.2.0-20060927-223657

download (155701 bytes)

Options -l and -0 added, bug with -p removed

Option -l (lines) and -0 (zero) allow argument reading from stdin.

version 0.1.0-20060812-040805

download (143137 bytes)

Options -o and -p added

option -o is "original" behavior, such that "mvatom file file file dir/" moves into directory. However it must end in a /, else it will not detect this case for safety.

option -p creates the missing directories in destinations. Note that option -r like in "mvatom -rd the/dir path/to/file" already creates path/to in the/dir for file. But it will not create the/dir, for this you must give option -p (like in "mkdir -p").

version 0.0.0-20060723-022835

download (137479 bytes)

First version. Nearly untested.

The "read from stdin" feature not yet supported, so you cannot do:

cat filelist | mvatom -d dest -
cat filelist | mvatom -b -

License and Disclaimer

All you can see here is free software according to the GNU GPL.
Copyright (C)2000-2011 by Valentin Hilbig
Note that the software comes with absolutely no warranty of any kind.
You use the software at your own risk.
Valentin Hilbig cannot be hold responsible for any unintended damage,
lost data or malfunction of the software you can find here.

[FSFE contributor 2007]

[end of page - jump back to content][hacker culture]
Last modified: 2011-09-12 by Valentin Hilbig [ Imprint / Impressum ]