I'm looking to buy a DS216+II to store family photos and videos, movies and music, important documents and the like. Part of these (especially the family stuff and the documents) I'd like to backup to another NAS, just in case one of them breaks down. Can this be done? If so, how do I install a NAS as a backup of another NAS running DSM6?
How to backup a Synology NAS to a Synology NAS
backupnassynology
Related Solutions
The solution is to keep a history of backups.
You can store one daily backup, say for the last seven days. Then one backup per week four times per month. This way, if the backup from yesterday had been saved in a bad state, you take the backup from the day before. Or you can take the backup from last week.
To save space you can either use a file system with supports deduplication, use hard links or store only the difference between the backup. Which solution is best, depends on your needs, setup and the software you run.
EDIT: You updated your question and added additional information.
As you already know, you have to separate the data from the backup. A backup is always redundant, if possible even more than one copy. I don't know your NAS solution and their backup software. But I can tell you how I solved this.
I use an old 300MHz system as backup server, which is connected to the file server (that would be your NAS in your configuration). Once per day the backup server switches on and pulls the backup from the file server and writes the data on its own hard drives. As backup software I use rsnapshot. No client computer has access to the backup server in any way. And it is only running for a short time per day.
This is only one possible solution out of many. The key points of a good solution are:
- Keep a history of backups
- A backup is always redundant
- A backup is stored on different hardware (e.g. a second drive, not a second partition on the same drive)
- The client computers must not have access to the backup
- The backup should be as easy as possible, at best fully automatic
- Depending on how often restores are expected, it should not be too big of a burden to restore the data
To setup SpiderOak 6 on Synology NAS running DSM 6 firmware
Foreword
The steps below were run on a Synology DS216+ running DSM 6.0.2, but would probably work on other NASes running Linux with small modifications. The SpiderOak version used was 6.1.3
I relied heavily on this page and this page as starting points.
Some things to note:
These instructions work as of November 2016.
Whenever instructions ask you to execute or run a command, they are referring to SSH (more info below). All SSH commands below should be performed as the root user. I suggest trying to understand what each command does before running it.
- The packages you should install depend on your CPU architecture. You can find out yours by executing
dpkg --print-architecture
in SSH. - If you know why step 26 below fails or how to fix it, please share!
Enable SSH
- Login to DSM (your NAS' web dashboard) by going to
http:<NAS-IP-ADDRESS>
- Within DSM, open
Control Panel >> Terminal & SNMP
- Check
Enable SSH service
SSH into your NAS
- Get an SSH client (I used Putty SSH for Windows; Macs have a built-in SSH client: Terminal)
- Find your NAS’ LAN IP address and SSH port. The IP is visible within DSM at
Control Panel >> Info Center >> Network tab
. The SSH port is 22 by default. - Use the IP and port to connect via SSH. Use the DSM login creds.
- In SSH execute:
sudo -i
to become root user. You will need to provide the admin password once more. For details, see this FAQ
Install Entware-ng (opkg package manager)
From SSH, follow these instructions to install the opkg package manager.
a. To determine the right version to install, rundpkg --print-architecture
. For instance, amd64 means you need version x86 64-bit.b. The instructions that require you to edit files can be accomplished by using the Vim editor. For example, to edit /etc/rc.local, run
vi /etc/rc.local
. Here's a quick intro to Vimc. For DSM 6 firmware, when the Entware-ng instructions ask you to edit /root/.profile, edit /etc/profile instead
Restart the NAS, log into SSH and run
sudo -i
to become root user- Run
opkg install nano
to get an easier text editor than Vim.
Install SpiderOakOne
- Go to SpiderOak website to get the URL to the installation package that matches your device. My NAS has a 64-bit processor so I chose Linux Debian 64-bit and my
PACKAGE-URL
ishttps://spideroak.com/getbuild?platform=ubuntu&arch=x86_64
- Run:
cd /root
to open the root directory - Run:
wget –output-document=spideroak.install.deb <YOUR-PACKAGE-URL>
to download and save the package - Once you get notice that spideroak.install.deb has been saved, press
Ctr+c
to return to the prompt. - Run:
dpkg-deb -x spideroak.install.deb SpiderOakONE
to extract the downloaded files into the /root/SpiderOakONE directory - Run:
rm spideroak.install.deb
to delete the downloaded package - Run:
mv SpiderOakONE /opt/SpiderOakONE
to move program files to /opt - Run:
sed -i /opt/SpiderOakONE/usr/bin/SpiderOakONE -e s+/opt/SpiderOakONE+/opt/SpiderOakONE/opt/SpiderOakONE+
This fixes paths in SpiderOak’s startup script to point to the correct path from step 17. To do this manually instead, open /opt/SpiderOakONE/usr/bin/SpiderOakONE and replace all instances of /opt/SpiderOakONE in the file with /opt/SpiderOakONE/opt/SpiderOakONE If you plan to backup a lot of data, the SpiderOak data folder will grow large during backups. In my case this filled the system partition and stopped the NAS from working properly. To fix this, I moved the data folder to the general partition where all my data is stored: /volume1
a. Run:
mkdir /volume1/SpiderOakONE
to create a new data directory. Replace /volume1 with whatever your general data partition is.b. Run:
ln -s /volume1/SpiderOakONE/ /root/.config/SpiderOakONE
to create a symlink so that accessing the old /root location will be automatically redirect to the new
Add NAS to SpiderOak Account
- Run:
ln -s /opt/SpiderOakONE/usr/bin/SpiderOakONE /opt/bin/spideroak
to create a symlink redirecting /opt/bin/spideroak to the program's real path. This allows us to run the program by simply enteringspideroak
in SSH instead of having to type the full path. - Run:
spideroak --help
to see the options available. If that command returns “command not found” step 20 did not work as intended. You could instead run the program using its full path:/opt/SpiderOakONE/usr/bin/SpiderOakONE –-help
. - Run:
spideroak --setup=-
to register your NAS with the service. You’ll need your SpiderOak username and password
Basic commands
- Run:
spideroak --include-dir=<PATH>
to add a directory to the backup set. Example of path might be/volume1/Pictures
.--exclude-dir=<PATH>
can be used instead to exclude certain directories. If the path includes spaces, you must wrap it in double-quotes. - To see what is currently selected for backup, run
spideroak --selection
; runspideroak --reset-selection
to reset. - To run a backup job, run:
spideroak --batchmode
You can add--redirect=<FILE_PATH>
argument if you wish to generate a log file. The backup will be interrupted if your SSH connection is broken (eg: your PC goes on standby) so I suggest scheduling backups to be executed as cron jobs by the NAS itself (see next section)
Setup a backup schedule
- DSM (web control panel) includes the ability to schedule tasks to be run regularly in
Control Panel >> Task Scheduler
. We should be able to use this to schedule regular backups with a command such asspideroak --batchmode
but even though this command works when running SSH as root, it fails when Task Scheduler tries to run it as root. I don’t know why. Instead I edited the crontab (the schedule) manually through SSH. - Look around for how to edit the crontab on your NAS. On mine, the following 4 steps apply:
- System scheduled tasks are stored in the file /etc/crontab. Run
cp /etc/crontab /etc/crontab.bak
to create a backup copy. If something goes wrong with the crontab edits later, restore from the working backup withcp /etc/crontab.bak /etc/crontab
- Run:
nano /etc/crontab
to open the schedule for editing. Nano text editor was installed in step 10. A quick web search will give tips on how to format crontab. For example to run a backup job at 10:30pm each night, add this line to the file:
30 22 * * * root spideroak --batchmode
Columns must be separated by tabs, not spaces. If the command fails to execute, replace spideroak
with its full path (see step 21). To log the results, add the argument --redirect=<FILEPATH>
and Spideroak will write a log at that path.
- If you want to just test whether things work without having to wait for a lengthy backup to complete, replace
--batchmode
with a much shorter process such as--selection
and check the log for the result - Finally, check whether your edits survive a system restart. Restart the NAS, log into SSH, run
sudo -i
to become root, andnano /etc/crontab
to inspect the schedule.
You've done it!
Troubleshooting & Tips
If in SSH, you get the error “command not found” for a command that used to work, it may be because /opt/bin or /opt/sbin are not in the PATH:
a. Run
vi /etc/profile
and edit the PATH section of the file (add:/opt/bin:opt/sbin
at the end of the PATH string)b. Restart the NAS
- If you run SpiderOak and get “Command line arguments not allowed during New User Setup”, it’s likely because the symlink we created in step 19.b was destroyed, so Spideroak can’t find its data folder. Redo 19.b.
- If your installation gets corrupted, you can re-initialize your device to the server with
spideroak --setup=-
. This may take a while because after setup the program will immediately complete a backup if needed: took my NAS 12hrs. - I had to factory-reset the NAS once, and so this setup was partially lost. To get things working after a reset, I had to redo step 8.b, 19.b, 20, reboot, and re-create the cron job (steps 26 to 31)
- If an SSH command fails with an error about permissions, execute
whoami
. If the result doesn't say "root", runsudo -i
to become root (you will need your DSM password)
Best Answer
It is a standard feature in DSM.
You need the "Hyper Backup Vault" package on 1 of the Synology devices to act as the backup target.
On the other your run "Hyper Backup" to make the backups.
You can specify exactly what part of the NAS you want to backup and how often.
Alternatively (if you are comfortable with that) you can simply enable the rsync service on the target and do command-line backups with rsync.
In that regard DSM is just another Linux distribution.
Another option if you don't want to buy 2 Synology devices: If you have cloud-storage somewhere you can backup to that. For most cloud-storage system there is a sync app for DSM available.
Personally (3 Synologies at home) I combine both techniques: I backup the critical folders (mainly photos) of 2 of them to the 3rd Syno (using Hyper Backup) and from there I send an extra copy to OneDrive with the OneDrive cloud-sync app.