develooper Front page | perl.perl5.porters | Postings from May 2003

Re: Urgent! BIG BUG in CCC & psync

From:
Dan Kogai
Date:
May 21, 2003 11:34
Subject:
Re: Urgent! BIG BUG in CCC & psync
Message ID:
9936B418-8BBA-11D7-8DFF-000393AE4244@dan.co.jp
On Thursday, May 22, 2003, at 02:59  AM, Eric Browning wrote:
> Mike and Dan,
>
> I've uncovered a serious bug in psync and CCC, or the interaction of 
> the two.  When my firewire backup drive is not connected and a 
> scheduled task runs it places the backup somewhere hidden on my 
> internal drive of my powerbook.  I used to have 18G of free space but 
> I've watched it decrese over the last few days to 3.23G, today, it was 
> 3.31 before the scheduled task ran.

What happened was that psync backed to the same drive.

> Where is this hidden location and how do I clean it out?

  If the name of your firewire drive is 'FireWire', check 
'/Volumes/FireWire' WITH YOUR DRIVE disconnected.  Erase that directory 
and reconnect FireWire.

The problem is that psync works on paths.  This is a classical *nix 
file system problem.  Even when you unmount the drive it "works" so 
long as the patch remains the same.

This is both a blessing and curse.  It is a blessing because you can 
work on file systems regardless of the media.  It is a curse because it 
sometimes leads into problems like this.

However, there is a simple way to check if a given paths is on a same 
volume or not.  Try a one-liner below.

perl -le 'sub d{(lstat(shift))[0]}; print d(shift)!=d(shift)' path1 
path2

Here is how it goes.

> % perl -le 'sub d{(lstat(shift))[0]}; print d(shift)!=d(shift)' / 
> /Volumes
>
> % perl -le 'sub d{(lstat(shift))[0]}; print d(shift)!=d(shift)' / 
> /Volumes/Backup
> 1

It prints 1 when different and empty line if same.

Even simpler one is as follows;

mount | grep /Volumes/Backup

print a line if /Volumes/Backup is actually mounted.

So far psync makes sure not to back up files which is located on the 
different volume ON SOURCE.  But it does not check if the DESTINATION 
VOLUME is different from the source.  It is deliberately made so that 
you can use psync for partial backups like "psync ~/Library/Preferences 
~/Preferences.bak".  Maybe I should add an option to make sure that 
source volume MUST be different from the destination volume....

Dan the Man with Too Many Modules to Maintain




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About