Wednesday, May 29, 2013

Backup/Sync Your Photos to Flickr Script


If you haven't heard, flickr has made their free storage 1TB for your full size photos. That's a lot of storage for your photos. I have a collection of photos since year 2000, and I have only around 81GB of photos stored to my hard drive and time machine and another backup drive, but those can all fail but I have been lucky not to lose photos from hard drive failures. I was looking for a sync apps to flickr that I can leave alone and I couldn't find one.

So here is a quick python script that I created. Here is how it works for backing it up:

Let's say you have folder
  / 2001-01-01
    / File1.jpg
    / File2.jpg

When you run flickrsmartsync it will require you to login give it access then it will sync it automatically, stopping and starting it will just resume it as long as it is in the same structure. So if you sync the same structure under the root folder in another computer it will sync to the same photo sets but will skip same filename. It also uses description to store paths for it since sets are single hierarchy design, everything is synced in a single level folder. So example above will create:

Title: 2001-01-01
Description: 2001/2001-01-01
Then photos File1.jpg, File2.jpg

So basically it is really designed only for backing up but doesn't stop you from really using flickr to share your photos as long as you keep the sets description in tact it will not re upload each photo.

Then to download the same format to another computer just run: flickrsmartsync --download 2008
This will create the same structure to the folder where you ran the script.

You can download directly from pypi here and run it directly with python:
it's also on my github at
Or install with pip:

    # with pip on unix systems (osx/linux)
    sudo pip install flickrsmartsync
    # if you don't have pip install it with on debian/ubuntu systems
    sudo apt-get install python-pip
    # or just download the source on pypi then cd to it and run
    sudo python install

    # Sample usage: go to the root directory you want to 
    # backup like the root of your Pictures folder then run
    $ flickrsmartsync
    # then to download to another machine or just restore deleted files
    $ flickrsmartsync --download .
    # to download specific folders
    $ flickrsmartsync --download 2008/2008-01-01
    # running from source without installation (same parameters)
    $ python flickrsmartsync-0.1.7/flickrsmartsync --download .

Windows update, since 0.1.7 version you should now be able to use this without dependencies, it's now included in the package. Here is the step by step instructions:

First download and install python here. Choose your windows version, it's tested on python 2.7, just install that for now. You can install multiple version of python. It should by default install itself in C:\Python27 now download flickrsmartsync package. If you can't extract it, here is a free open source tool 7zip. Once everything is installed extract the tar flickrsmartsync-0.7.1 in the location of your photos like your my pictures then type cmd in your start menu:

    cd Pictures
    # This should upload all photos under your pictures folder
    C:\Python27\python.exe flickrsmartsync-0.7.1\flickrsmartsync
    # To download, same parameters as above
    C:\Python27\python.exe flickrsmartsync-0.7.1\flickrsmartsync --download .