After doing some research for a backup and storage solution I decided to go with Synology’s DiskStation DS 213. It’s a NAS server that can hold up to two hard drives internally. I use it primarily as a storage and backup device with two 3TB drives.


Especially when it comes to family photos and home movies my laptop and external drives were not a viable solution any more due to capacity limitations. Having all music files in one place and be able to access it with all devices was another good reason for taking the step to consolidate my data.

Although Synology offers some good solutions with the DiskStation’s operating software DSM, a desktop client and a set of great Smartphone apps I wanted the DiskStation to completely take care of my photos and home movies that I feed it through the SD card slot. In my case these are jpg and mts files. However, the underlying exiftool that is used for processing the meta data is able to process all kinds of formats.

UPDATE: After upgrading the operating system to DSM 4.2 exiftool was not present any more. That’s why I had to include the step Get exiftool and made some changes to the script.

UPDATE: The link to the bootstrap script was broken and, therefore, replaced.

UPDATE (2013-10-27): I rewrote the entire script to allow manual use and more flexibility.

Here is how to set this up. I assume that you are able to use a terminal software and open a SSH connection. This process will involve modifying your server. So, before you do so, make sure to read this disclaimer!

  1. Enable SSH
    • Go to the DSM webinterface by typing the DiskStation’s IP address into your browser
    • Navigate to Control Panel > Terminal and “Enable SSH service
  2. Access your server via SSH with your root account
  3. Bootstrapping/ installing ipkg: You need to modify your DiskStation to add some additional software. The instruction on how to do that can be found here. As an example, I will list the necessary commands for my DS 213.
    • cd /volume1/@tmp
    • wget\
    • chmod +x syno-mvkw-bootstrap_1.2-7_arm.xsh
    • sh syno-mvkw-bootstrap_1.2-7_arm.xsh
    • reboot
    • rm /volume1/@tmp/syno-mvkw-bootstrap_1.2-7_arm.xsh
    • vi /root/.profile

      Comment out and save by going to both lines and hit the following keys for both lines “SHIFT+i”, “#”, “ESC”

      #export PATH

      Type “:”, “x” to save and quit. If you don’t have these lines, just type “:”, “q” to exit.

    • ipkg update
    • ipkg upgrade
    • ipkg install bash
  4. Get exiftool
    • cd /lib/
    • wget\
    • tar xzf Image-ExifTool-9.39.tar.gz
    • rm Image-ExifTool-9.39.tar.gz
    • ln -s /lib/Image-ExifTool-9.39/ exiftool-folder
  5. Create directories for the script
    • mkdir -p /volume1/ron/scripts/photo-movie-helper
  6. Downlad the script into the script folder
    • cd /volume1/ron/scripts/photo-movie-helper
    • curl -O\
  7. Reroute the original synousbcopy script
    • cd /usr/syno/bin/
    • mv synousbcopy synousbcopy_renamed_by_ron
    • ln -s /volume1/ron/scripts/photo-movie-helper/\ synousbcopy

Please note that you have to repeat steps 1, 2, 3, 4, 7 after you have updated the operating software DSM.

My script can be found on GitHub and here:

All you have to do now is to insert a SD card with photos or home movies and hit the copy button on the DiskStation’s front panel (marked with a “C”) and the rest will be done automatically. A beep notifies you when the script is finished.

During the copy process the DiskStation creates a folder within the folder SDCopyFolder in the format SDCopy_YYMMDDhhmm. After the script is done with processing the latest folder it should not contain any pictures or movies any more – unless the files already existed.

These folders are not being removed by the script to have the contents intact in case something does not work properly. Additionally, the files on the SD card have to be removed manually as well.

Should you forget to clean the SD card and insert it again with new and old files a new SDCopy folder will be created, but only files that do not exist in the target folder will be moved this time.


19 Responses to How to Set Up Synology’s DiskStation to Automatically Transfer, Rename, Move and Index Photos & Movies

  1. nico says:

    this is great!
    exactly what i’m looking for! but I am a bit frightened about the terminal commands … I will take a look and try asap.
    do you know it the script recognizes .rw2 files (panasonic raw)?
    would be wonderful to have the script duplicate raw files and convert them in jpeg.
    this would be a great application to have in a synology nas, you should propose that


    all the best, n

    • werschi says:

      due to the exiftool commands the script will only process *.jpg and *.mts files, you would have to adapt it to handle .rw2 files. (i will do the same for .pef)

      exiftool is not a raw converter, i can’t process raw files into jpeg. it could extraxt the low quality preview jpeg out of the raw files, but this is probably not what you want.

  2. mederel says:


    thank you for this informative Howto.

    I wanted to mention though, that it is out of date:
    the following command is not completing successfully:
    => `syno-mvkw-bootstrap_1.2-7_arm-ds111.xsh’
    Resolving… failed: Temporary failure in name resolution.

    Seems the file is not online any longer. Do you have a copy of it somewhere? Would you be so kind as to upload it to your server to make anew accessible to us poor readers?


  3. pgflyer71 says:

    Could this script be remade to work on DS-412+ ? It doesn’t have SD card slot or Copy button. I was thinking of using the USB-SD adapter and power button?!
    Any suggestions?

  4. Ian Purves says:

    Thanks this has been a great help!

    Just a couple of issues I ran into that might help others …

    1. You need to enable the PERL package on DSM (obvious but …)

    2. I have a 213+ which has a different processor so I used for the bootstrapping which was brilliant

    3. On step 6 I needed to use a “-k” on the curl command due to SSL issues

    4. It was not initially obvious that in the script that USE_SYNOUSB=true but I was probably being a bit thick

    5. On my NAS it was necessary (as a final step) to change permissions on the script so that it can be executed with the [C] button …

    chmod ugo+rwx /volume1/ian/scripts/photo-movie-helper/

    As a final comment, I don’t like vi so I used (note: you need to disable the new DSM Security Option “Improve protection against cross-site request forgery attacks”)

    Thanks again

  5. Gregory Titievsky says:

    I have a Synology DS-213 and trying your steps, but I’m getting the following when I try to run syno-mvkw-bootstrap_1.2-7_arm.xsh:

    DiskStation> sh syno-mvkw-bootstrap_1.2-7_arm.xsh
    Optware Bootstrap for syno-mvkw.
    Extracting archive… please wait
    1232+1 records in
    1232+1 records out
    Error: CPU not Marvell Kirkwood, probably wrong bootstrap.xsh

    BusyBox v1.16.1 (2013-11-06 05:31:51 CST) built-in shell (ash)
    Enter ‘help’ for a list of built-in commands.

    Is there something wrong with the script?

  6. Gregory Titievsky says:

    seems to have found the answer here:

    If the output of the command “cat /proc/cpuinfo” mentions a “Feroceon” CPU, then you may safely open up the file “/volume1/bootstrap/” and edit line 21, changing “Feroceon-KW” to just “Feroceon”, and run the script manually with “sh /volume1/bootstrap/”.

  7. Marcel says:

    This seems to come very close to what I am looking for. I want to move all my photo’s to my Synology (bought an expansion especially to have enough space), and properly structure it this time for good. I like how the packages are doing my music, ebooks, movies and series, so next up are the photos and the videos.

    I looked at the Photo Station package and tried to upload a few folders with the assistant from my workstation. So what I was looking for or hoped it would offer is some options for moving and properly restructure the photo’s in some way. But it only offers to keep the existing folder structure or basically remove it (all photos in the root).

    Our existing photo’s are done with different camera’s, import software and therefore stored basically in all kinds of different ways. Time to fix it.

    So from the above information, it seems that your script can really do a lot of cool stuff; which is great. Do I understand correctly that it can rename, move and put the photos in some kind of folder logic (e.g. I like the logic with HeadPhones, how my music is organized).

    The big difference is that I will not copy it from a SD card, but will properly dump the photos in some shared folder on the Synology (e.g. \volume2\photodump\) Then the script should detect and process the photos. Is that possible?

    Second question, I have a DS713+, will it be very different from your 213? I did a comparison on the Synology website and cannot find much difference. Only that the CPU is different; will that mean another way for bootstrapping?

    Thanks a lot!

    • Paul says:

      Marcel, if you are importing existing photos you could just install ipkg (, install exiftool and then run an exiftool command to move/copy and rename the photos into e.g. a year/month folder structure. The script described here is for automating the import, renaming and indexing. Once you have all old photos imported and renamed, you could then in the future just use the sdcopy import script described here.

      I use the following for that (note, run using putty from the folder you want the photos moved to, e.g. volume1/photo/):

      #rename and move photos in folder SdCopy to folder !in current folder! (volume1/photo) according year and date, example: 2012/05/120530_1029-55_IMG_1345.jpg

      exiftool -r '-FileName<CreateDate' -d %Y/%y%m/%y%m%d_%H%M-%S_%%f.%%e -P /volume1/SdCopy

      I would like to see this as a package, every DSM update breaks the installs and scripts/cronjobs. Would be great to have it just through a package.

  8. Sjoerd says:

    Very good stuff, thanks a million. Two suggestions:
    1. Perhaps submit to Synology to have them update their DSM with this?
    2. Perhaps possible to package this and offer through e.g. Synocommunity?

  9. Fuzzy says:

    Hi, very cool script. But I’ve got two issues (DS713+ USBCopy)

    1. The pictures in subfolders of the “Input Folders” were ignored. Is there a possibility to take these picture also?

    2. I can start the script only by typing “synousbcopy” in a shh connection. The C Button doesn’t work. I changed the rights like Ian Purves but no effect. Any ideas?


  10. Jerome says:


    I have the same problem as Fuzzy with the latest DSM 5 version, do you know how to enable the USBCopy button function ?


  11. Jason says:

    Can someone explain this to me like I’m 5. I’m trying to set this up and I’m super confused. I’m running DS213 with DSM5.1. Thanks.

  12. Nexius2 says:

    there is a package to rename photos…
    add this repo “” and you’ll see U.Renamer

  13. Nexius2 says:

    PS: Exiftool is also available for those who wan’t

  14. Maxrock70 says:

    Hi, I developed a script to automatically move tvshows and movies and it is based on filebot package. You can find the script here

  15. M3 says:

    Step 6 doesn’t seem to download the file anymore?
    adding -k option, as suggested by Ian also doesn’t yield any return.
    Also there is no error message. The download just seems empty.
    Any solution to this? TIA

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>