try-copying-up-to-n-times 1.0 review
Downloadtry-copying-up-to-n-times is a script I wrote to facilitate recovering data from a filesystem that shows inconsistent behavior - some
|
|
try-copying-up-to-n-times is a script I wrote to facilitate recovering data from a filesystem that shows inconsistent behavior - sometimes a file looks fine, and other times the file won't be readable, or the filesystem will even crash when you try to read a particular file or series of files.
The general flow of usage is:
- Create and seed a database for the source directory, with -i, carefully selecting the number of reattempts you want before a file is marked "failed", aka "unrecoverable". Wait while an iteration is attempted.
- Run more iterations with -r, until you've had enough.
- In both of the above cases, you may want to specify -c or -C to determine some conditions under which the script will stop trying for the time being (until you rerun it).
Usage:
esmf04m-root> ./try-copying-up-to-n-times
./try-copying-up-to-n-times: -i, -r, -m, -g, -s and -e are mutually exclusive, and exactly one must be specified
Usage: ./try-copying-up-to-n-times [-i databasefile initialrepetitions] [-r databasefile initialrepetitions] [-e databasefile]
"-i databasefile repetitions" says initialize the database.
Repetitions is the max number of times we will try to copy a given file
"-r databasefile" says restart: continue counting down repetitions
"-e databasefile" says delete a preexisting database
"-d sourcehier desthier" says to copy data from sourcehier to desthier
"-m databasefile repetitions filename" says to set filename's repetition count to a specific
value, manually
"-g database filename" says get the value for filename's repetition count
"-s database" says to summarize counter status for all files in the database
"-v n" says to operate verbosely. Higher n is more verbose. 1 is only for definite error conditions,
2 is surprise (non-)preexistence conditions, and 3 is for the whole ball of wax
"-c shellcommand n" says to run shellcommand after attempting to copy n files. If the command
returns POSIX shell false, ./try-copying-up-to-n-times will exit. Otherwise we continue
"-C n" says that if %s sees n consecutive file errors, terminate prematurely
-i, -r, -m and -e are mutually exclusive
Only regular files, directories and symlinks are handled at this time. Hard links are not
preserved, their relationship will be broken silently
This program uses the python anydbm interface, so it may seemingly at random choose a backend
database like berkeley db, gdbm, dbm, dumbdbm or others. However, once a database of a given
name is created, subsequent usage of that same database name should come
up with the same type.
try-copying-up-to-n-times 1.0 search tags