Step 1 | Step 2 | ![]() | Step 4 |
Connect with SSH to your Synology NAS:
ssh root@<ip-address>
root@<ip-address>'s password:
<password>
Run all the following commands on your command line:
Important: Replace these sample data with your own data!
Your online backup acount (z.B. 4000000):
OnlineBackupUser=4000000
The place, which you noticed out of the web interface in the last step (default is "/volume1/OnlineBackup"):
OnlineBackupDir=/volume1/OnlineBackup
Schedule the hour for the automatic backup (cronjob):
OnlineBackupHour=01
Schedule the minute for the automatic backup (cronjob):
OnlineBackupMin=00
Copy the following code into your command line and execute it:
# change into previously created online backup directory
cd $OnlineBackupDir
# decompress the previously downloaded file
unzip latest.zip
# clearing up
mv online-backup-latest/* . && rm latest.zip online-backup-latest/ -R
# generate a ssh key
ssh-keygen -t dsa -b 1024 -N '' -f conf/onlinebackup_id_dsa
# readout the backup name
OnlineBackupName="$(/bin/hostname)"
# copy the configuration files
cp conf/OnlineBackup.conf.default conf/OnlineBackup.conf
cp conf/OnlineBackupExcludeFiles.conf.default conf/OnlineBackupExcludeFiles.conf
# adjust confiugration
sed -e "s/^REMOTEUSER=.*/REMOTEUSER=${OnlineBackupUser}/" \
-e "s/^REMOTEHOST=.*/REMOTEHOST=31.216.40.129/" \
-e "s|^PRIVKEYFILE=.*|PRIVKEYFILE=${OnlineBackupDir}\/conf\/onlinebackup_id_dsa|" \
-e "s|^INCLUDEFILE=.*|INCLUDEFILE=${OnlineBackupDir}\/conf\/OnlineBackupIncludeFiles.conf|" \
-e "s|^EXCLUDEFILE=.*|EXCLUDEFILE=${OnlineBackupDir}\/conf\/OnlineBackupExcludeFiles.conf|" \
-e "s|^PERMSCRIPT=.*|PERMSCRIPT=${OnlineBackupDir}\/tmp\/SetPermissions.sh|" \
-e "s|^LOGFILE=.*|LOGFILE=${OnlineBackupDir}\/log\/OnlineBackup.log|" \
-e "s/^PARTITIONFILE=.*/#PARTITIONFILE=/" \
-e "s/^REMOTEDIR=.*/REMOTEDIR=${OnlineBackupName}/" \
-e "s/^RSYNCBIN=.*/RSYNCBIN=\/usr\/syno\/bin\/rsync/" \
-e "s/^SCHEDULEDHOUR=.*/SCHEDULEDHOUR=${OnlineBackupHour}/" \
-e "s/^SCHEDULEDMINUTE=.*/SCHEDULEDMINUTE=${OnlineBackupMin}/" \
-i conf/OnlineBackup.conf
Determine the backup scope:
Set the absolute path of the folder, which you desire to include in your backup (e.g. "/volume1" for the whole volume). Subfolder are included automatically.
If you desire to include serveral folders, run the following commands repeatedly:
OnlineBackupInc=/volume1
echo ${OnlineBackupInc} >> conf/OnlineBackupIncludeFiles.conf
Copy the public ssh key onto the backup server:
rsync conf/onlinebackup_id_dsa.pub ${OnlineBackupUser}@31.216.40.129:.ssh/authorized_keys
Testing the connection:
ssh ${OnlineBackupUser}@31.216.40.129 -i conf/onlinebackup_id_dsa
If you could connect successfully, press CTRL-D to exit.
Testing and initialize the online backups:
This process might take several minutes!
${OnlineBackupDir}/bin/OnlineBackup.pl -c ${OnlineBackupDir}/conf/OnlineBackup.conf