Synchronize Synology Photo Station to Piwigo with rsync

Yes this is mostly to help me remember the command line but there’s a couple other tricks I need to remember too.  For context I use a Synology box for a local file server in the house and host a gallery of mostly family and friends photos and some videos of about 100G of data and 13,000 files.  I want to keep a complete backup copy in the cloud and piwigo is an excellent gallery tool with all the usual features.  It also lets you synchronize with the local files so that I can use rsync to keep my photos  up to date with the master at home.  I should post about it but I also really love the map plugin.

Compare my photo station with the replicated piwigo site.

First the magic:

sudo rsync -avhK --exclude '@*'  --no-g --no-o --delete   photo > /var/services/homes/jvail/gal2.txt

Now the tricks.  First the photo station photos are in


And at the other end piwigo stores photos in galleries/ under it’s home path.  On Dreamhost this is ~/ for my site.  Next since we are using rsync source of ‘photo’ and synchronizing to ‘galleries’ I created a local symlink photo–>galleries and used the -K for rsync.

I want to replicate exactly and delete deleted or moved files I use –delete but make sure you get index.php onto the diskstation so it isn’t lost.

On the synology it seems to use files and directories starting with @ for meta files like thumbnails which I didn’t want to replicate on the external site:

--exclude '@*'

And finally when the rsync is complete don’t forget to to go into admin on the piwigo site and tell it to synchronize.

One thought on “Synchronize Synology Photo Station to Piwigo with rsync

Leave a Reply