[Dirvish] Trying to get a file adopted by dirvish (but slipped in via sneakernet)

Paul Slootman paul at debian.org
Wed Jun 9 10:38:51 UTC 2010

On Wed 09 Jun 2010, Jedd Rashbrooke wrote:

>  I have one small problem, though.  Not a show-stopper, but I'm
>  more and more curious about it.  If I knew perl this would probably
>  be easier to solve, I guess.

The heavy lifting is done by rsync; the dirvish perl stuff is mostly
keeping track of things and calling rsync with the right arguments.

>  With a starting position of a large source directory, and an active
>  dirvish vault, at each end of a low-bandwidth link - I want to be
>  able to add a file to each end at the same time without having
>  to traverse the link.  That is, if I know I'm about to put a big file
>  into the file server one day - I can copy it onto a USB drive, wander
>  over to the data center, transfer it to the dirvish vault, and then
>  later that night dirvish run-all will merely produce a hard link to
>  that file in the new day's vault entry.
>  I've tried a few approaches - modifying 'yesterday's' tree to include
>  this new file, modifying all existing trees to include the file,
>  making sure the date and uid/gid owners are the same, etc.  But
>  I'm still seeing (via stat) that dirvish is producing a new file (or
>  a new inode, if you prefer) on the next run.

Placing the new file in the latest image (in the right location!) before
running dirvish should do the job. I suspect that the metadata of the
file differs somehow from the original, getting changed perhaps when
transferring to the USB drive.  The attributes that are important are:

- filesize (shouldn't be an issue)
- owner/group (tricky in case of a FAT32-formatted USB drive)
- permissions (ditto)
- timestamp (ditto)

Perhaps it would be better to package the file in a tar archive,
i.e. don't copy the file to the USB drive but write a tar archive on the
USB drive with the file in it; and then at the dirvish server extract it
again. Use --numeric-owner --same-permissions as options for (GNU) tar.


More information about the Dirvish mailing list