Member
Member
cogmios   2008-05-02, 22:27
#1

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

Developer
Developer
trisweb   2008-05-02, 23:51
#2

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!

Member
Member
cogmios   2008-05-04, 12:06
#3

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.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.