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

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.2-20081016-214847

Move files by atomic rename instead of copy. (Includes dirlist) (look into latest version, download latest version 0.4.2-20081016-214847, sig)

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 (default, introduced in 0.5.0) it uses 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.

There also now is "dirlist" a little helper to create directory lists. This is for mvatom option "-l -"

History:

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.

[view more history][view complete history]

License and Disclaimer

All you can see here is free software according to the GNU GPL.
Copyright (C)2000-2008 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: 2008-12-27 by Valentin Hilbig [ Imprint / Impressum ]