keithl at kl-ic.com
Thu Jan 6 16:25:27 PST 2005
I have been thinking about single file or simple directory restore.
I am building a program that works something like:
dirvish-file-restore [-iv] [--vault vault] [--date date] [pattern]
The pattern might be something like:
/home/fgump/sources/foo/fum.c (assume server)
/home/fgump/sources/foo/* (all files and subs in directory)
/home/fgump/sources/foo (restore whole directory and subs)
If the -v switch is given, the program will explain what it is doing
before doing it, and if the -i switch is given, the program will ask
again for each parameter (default to the command line or to the result
of a search), and then ask again before executing.
If there is no pattern and no -i switch, the program will exit with
an error code.
If the vault is not given, the program will use loadconfig to figure
out which vault contains it. If more than one vault contains the file,
the program will use the "most specific" vault, that is, it will use
data in the vault rooted at a subdirectory.
If the date is given, the program will use the version of the backup
of that date, or one preceding. If not, it will use the most recent
If the program detects an existing copy of the file or directory, it
will use rsync's --backup option to create a client-local backup
version with tilde (~) appended, like fum.c~ .
Afterwards, the program will look to make sure the files actually
made it, and describe what happened/changed if the -v switch is given.
I am also assuming that the system administrator running this is
using "dirvish-locate" to find what is available to restore.
Is this the right way to do it? How would you do this? I realize
the program doing more work than it absolutely has to, but the idea
is to save the system administrator as much thinking as possible.
Oh, and anyone that wants to write the program for me is welcome to
contribute, subject to editing, of course.
Keith Lofstrom keithl at keithl.com Voice (503)-520-1993
KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon"
Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs
More information about the Dirvish