Thu, 22 Aug 2002
File synchronisation experiments // at 23:59
So much for the spring-like weather! Almost warm this morning on the ride to work, then cold and grey and drizzly rain all afternoon. Not the kind of weather to inspire me to leave work and ride home, maybe it was a plot created by the ITS management to make me work longer hours.
This evening I explored the strange behaviour of tra. Or maybe I'm
just not understanding how it works yet. Two config files, work and
sng-work, corresponding to the directory $HOME/work both on my home
machine on at Monash.
bash-2.05b$ cat ~/.tra/work #!/bin/sh trasrv $HOME/.tra/work.tradb /home/ajft/work bash-2.05b$ cat ~/.tra/sng-work #!/bin/sh ssh sng.its.monash.edu arch/SunOS/bin/trasrv .tra/sng-work.tradb /cc/ccstaff1/a/ajft/work
A subdirectory, FRED containing a single file.
bash-2.05b$ ls FRED/ log.txt bash-2.05b$ rm -r FRED/
Run minisync from here to Monash, and nothing happens. I would have
expected it to remove the file and directory.
bash-2.05b$ minisync -v work sng-work
Run minisync back the other way and sure enough, it copies back the
missing files.
bash-2.05b$ minisync -v sng-work work copy /FRED/ copy /FRED/log.txt bash-2.05b$
Remove just the file, leaving an empty directory, and then sync.
bash-2.05b$ rm FRED/log.txt bash-2.05b$ bash-2.05b$ minisync -v work sng-work remove /FRED/log.txt
Ok, that behaved as expected and deleted the file from the destination. Now remove the directory and sync.
bash-2.05b$ rmdir FRED/ bash-2.05b$ bash-2.05b$ minisync -v work sng-work remove /FRED bash-2.05b$
Again, that behaved as expected. So it looks as if tra only removes
empty directories, and chickens out from removing them if they go from
non-empty to non-existant.
