Synchronizing local photo dir with Webhost

I have my local foto directory on my synology NAS box. On there I have /volume1/photo which my family can access e.g. my wife using Picasa. In this volume I have created folder s per year.

What I wanted to have is some way to auto synchronize my local photo storage dir and my web album under zen photo since in that way, if the NAS box explodes I have a safe copy AND I have the benefit of using it as a web album also.

I wrote a little script to run on the NAS. Any NAS where you can install lftp via the nslu2 linux ipkg will probably work also, maybe this is of use for some of you:

-------------------
#!/bin/ash
SOURCE=/volume1/photo
BACKUPDIR=/domains/test.com/html/gallery/albums

cd $SOURCE

lftp -u serveradmin@test.com,WACHTWOORD ftp.9999.gridserver.com << EOF
mirror -R -n -I *.jpg -I *.JPG -X @eaDir/ -X Collage/ -X 'Vanalles/' -X .piccache/ -X .recent/ -X Originals/ -X *.Db . $BACKUPDIR/

quit
--------------------

Some notes:

1) before CRON ning this try to run it a couple of times from the command line itself
2) if you have photo's which it will keep uploading/updating it means that the date of the photo is wrong e.g. "00-06-12", I had some older digital pictures so I changed the dates.
3) i had 1 directory on which it stalled, after renaming this directory (probably some weird characters) it ran through
4) I have now made several scripts per year, because probably only within the latest year the most mutations will take place.

After that you can CRON it, so it will run happily on your NAS without you having to upload any pictures any more by yourself.

It also means that my wife can just copy the contents of her NIKON card to a new folder on the F:/ drive (following an explanation sheet) and all the rest happens automatically e.g. foto's appear in Zen automatically.

Hope this helps someone if you need to enhance your family photo collection experience using Zen.

Edward de Leau
http://edward.de.leau.net

Comments

  • trisweb Administrator
    Very, very cool.

    I'm not sure how the 'mirror' command works, but if it doesn't do incremental file transfer, I'd look into rsync. It will sync only the changed files. Something to think about anyway.

    Thanks for the script!
  • cogmios Member
    Hi tris, thanks,

    rsync was not supported thats why I used lftp.
    this script also only updates the changed files, so if you CRON it, it will only update the photo's you changed (so both new and changed ones).

    its also possible to delete files you deleted (auto) but i didnt do that for safety.

    if someone is going to use this: you can also IPKG screen to run it in the background instead of CRONing it.
Sign In or Register to comment.