Herein is a script which can synchronize/update/transfer files on two
Linux-based computers via a floppy.
(Note that this is similar to
net_xfer
available in the October 1999 issue of
SysAdmin magazine, but uses a floppy approach instead.)
Important note: Although I am willing to explain how these
programs and scripts work, I am not willing to write programs for you (unless,
of course, you pay me a great deal :-). All this software is provided
as-is and it is your responsibility to modify it to your
liking.
To use:
- Obtain and then install afio (I use version 2.4.2) and
rsync (I use version 1.6.3).
- % mkdir $HOME/trash
- Under C-shell:
% setenv TRASHDIR $HOME/trash
or under Bash:
$ export TRASHDIR=$HOME/trash
(Obviously, you can use any name you wish for TRASHDIR other than
$HOME/trash.)
- Under C-shell:
% setenv PLATFORM ""
or under Bash:
$ export PLATFORM=""
- On your "work" system (the other system), under C-shell:
% setenv WHERE work
or under Bash:
$ export WHERE=work
- On your "home" system (your system), under C-shell:
% setenv WHERE home
or under Bash:
$ export WHERE=home
It is important that $WHERE be set regardless. Otherwise,
fdbackup will not know how to act.
- % mkdir $HOME/work
% mkdir $HOME/home
- (Optional) Set up an alias for mv. Under C-shell:
% alias mv "mv -q"
or under Bash:
% alias mv="mv
-q"
This is essentially a way of doing "noclobber" with mv.
This can be useful.
- Put rm, mv, timeon, and timeout in your path
after compiling them (hopefully, "make rm mv timeon timeout" will
work). It is important that the rm and mv provided are in
your path before the default versions (usually located in /bin) and that
you use them always. (You can test whether you are getting the right
ones by doing "which rm" and "which mv".) If you do not use
the provided rm and mv, you will not gain the benefits of
files being moved/renamed and removed identically. (A file
$TRASHDIR/rmmv_trail.out is generated which records all this
information. This file is accessed in fdbackup.) All files
removed with rm are moved to $TRASHDIR. It is probably
worthwhile to delete the files and directories in there occassionally. (I
have a script which will delete files in there based on access and
modification times of the files; if you would like me to make this
available, please tell me.)
- Modify fdbackup and fdbackup.aux (both in the bin
directory) to suit your needs. Points of note:
- cleanall is a script you must write to clear away some space (you may
want to delete stuff from your $TRASHDIR directory). This is an
important script because rsync has an unfortunate habit of hanging if
there is insufficient disk space to complete. The one argument it is
passed is the number of blocks needed.
- All directories are sychronized except folders/procmailed/scored,
text/per_download_mail and folders/archive1, which are
moved (i.e., they are deleted from the source system
(generally "work") and put onto the destination system (generally
"home").)
- text/per_download_mail/phnx*.txt, unlike other files in
text/per_download_mail, are overwritten, not appended to.
- fdbackup.aux's purpose is to generate $TRASHDIR/fdbackup.list.
This one you'll definitely want to modify.
- If you are running X-windows and have xmessage, you should
set the environment variable FDBACKUPXWIN to any value.
- fdbackup calls fdbackup.aux, so both must be in your path.
- Use fdbackup. With no arguments, it both reads and writes to a
floppy. fdbackup with 1 argument will do read; with 2 arguments, a
write. Note that if you do not use the enclosed rm program, any
synchronized files are subject to being deleted forever!!
Here is the software: robertutils.tar.gz
Note: I also have a wrapper for "gzip" and "gunzip" which
puts info into $TRASHDIR/rmmv_trail.out. I may make it available
if there is demand. Please ask.
Date Last Modified: Thu Feb 15 16:02:50 UTC 2007