It is based on time-stamps, and compares the modification times of files on the two machines. It also keeps a list of files (directories) that need to be ignored (e.g., it's no use to copy executables, between the two systems). The system consists of two scripts and one C program.
The implementation that I use is rather primitive, and also contains some unwanted features, but although I have often thought about improving it, I have never come to do it, as it does work fine for the purpose I am using it.
The program expects that the file .dt.in contains the directory listing of the other system, and that the file .dt.new the current directory listing of the you are exporting from. All files that are newer in .dt.new than in .dt.in, are candidates for being exported to the other machine. For each of this file the users can give the following replies:
At the end the program writes the following files:
#!/bin/cshThen I have a line to also save a copy of by incoming mail box:
cp /usr/spool/mail/faase ~/inboxThen I have to collect all the files.
set dtz = $1 echo $dtz ls -dalg * */* */*/* >.dt.newActually, I am using something like the following, because the argument list gets to long. (Not so, nice, but it works.)
ls -dalg * >.dt.tmp ls -dalg Calendar/* >>.dt.tmp ls -dalg News/* News/*/* >>.dt.tmp ls -dalg Mail/* Mail/*/* >>.dt.tmp .... sort +0.54 <.dt.tmp | uniq >.dt.new rm .dt.tmpThen I call the compare program, which compares .dt.new with .dt.out, and generates .dt.make, .dt.out and .dt.del. It also read and writes .dt.ignore.
dcompareAnd now to the real job:
chmod +x .dt.make .dt.del echo do: more ./.dt.make ./.dt.make echo zipping: gzip .dt.diskAnd copy everything to disk:
echo copy to a: mdel a:$dtz.DTZ mdel a:$dtz.LS echo mcopy .dt.disk.gz a:$dtz.DTZ mcopy .dt.disk.gz a:$dtz.DTZ echo mcopy .dt.out a:$dtz.LS mcopy .dt.out a:$dtz.LSClean-up, and deleting old stuff. (Somehow this is nice. I do find all core-file that are generated, and can clean them up immediately.)
rm -i .dt.disk.gz echo deleting: ./.dt.del rm .dt.out .dt.new .dt.make .dt.del
#!/bin/csh echo copy $1.DTZ to .dt.disk.gz mcopy a:$1.DTZ .dt.disk.gz echo copy $1.LS to .dt.in mcopy a:$1.LS .dt.in if ( -f .dt.disk.gz ) then echo unzip .dt.disk.gz to .dt.disk gzip -d .dt.disk.gz else echo .dt.disk.gz not found endif if ( -f .dt.disk ) then echo untar .dt.disk tar -xwf .dt.disk rm -i .dt.disk else echo .dt.disk not found endif