October 13th, 2002

  • brad

fotoup.pl --backup

fotoup.pl can now do incremental backups of your entire account.

Example ~/.fotoup.conf:
server: picpix.com
username: brad
password: sdlkfjsdlk
defaultsec: 255

backupdir: ~/fotobilder-backup
backupindex: ~/pictures, /raid/media/pics

Example session:
papag:bradfitz $ fotoup.pl --backup
Fetching export.xml from server...
Discovering existing pictures in: /raid/bradfitz/pictures
  7963 files already known.
Discovering existing pictures in: /raid/media/pics
  3056 files already known.
Total pictures: 383
Already backed up: 374
Pictures to backup: 9
Bytes to fetch over network: 2781430
  Fetching image 1/9 ...  5.1%
  Fetching image 2/9 ...  7.0%
  Fetching image 3/9 ...  23.0%
  Fetching image 4/9 ...  47.3%
  Fetching image 5/9 ...  62.7%
  Fetching image 6/9 ...  74.5%
  Fetching image 7/9 ...  85.5%
  Fetching image 8/9 ...  98.7%
  Fetching image 9/9 ...  100.0%

Cool details:
It won't download images you already have on your harddrive (in backupindex directories). Instead, it just makes symlinks to them.

The existing pictures in backupindex dirs are scanned quickly on startup, to see if there's new stuff, stuff removed, or any files modified.

If a complete file (not a symlink) is in the backup dir and the equivalent file later is copied elsewhere, it's changed to a symlink.

If symlink target breaks or changes, fotoup.pl will repair it, or download the file again.

In summary, it works really damn hard to always do the safe, smart thing, and minimize local disk space and network usage.

Contents of backupdir after running:
$BACKUPDIR/export.xml --- all account info
$BACKUPDIR/pool/* -- forest of directories containing raw pictures