A few visitors of this website requested a tutorial on how to synchronize one folder from one NAS to another one. Of course this tutorial requires fun_plug installed on your NAS.
Attention: I describe unencrypted connections ins this tutorial, for encrypted ones, please visit the online search provider of your choice with the keywords “rsync ssh”.
Attention: Existing configurations of the rsync-server are maybe overwritten. Users who changed something in this area are advised to integrate this tutorial in their configuration on their own. Werbung
The scenario is the following: The NAS Alice contains a folder named Foo, which should be copied to the NAS Bob into the folder Bar. Changes in Foo will be copied to Bob, changes in Bar will be overwritten by the contents of Foo.
Let’s start 🙂
Download of the required files
Please execute the following steps on Alice:
cd /ffp/etc/ wget http://wolf-u.li/u/370 wget http://wolf-u.li/u/371 wget http://wolf-u.li/u/372 chmod 600 rsyncdsecretsfile
And the following ones on Bob:
mkdir -p /ffp/var/opt/uwmirrorfolderrsync/ cd /ffp/var/opt/uwmirrorfolderrsync/ wget http://wolf-u.li/u/375 wget http://wolf-u.li/u/374 chmod 600 uwmirrorfolderrsyncpass chmod a+x uwmirrorfolderrsync.sh cd /ffp/start/ wget http://wolf-u.li/u/376
Now all required configuration files are downloaded to the NAS.
Now login to Alice and edit the file
/ffp/etc/rsyncdsecretsfile. There you need to replace
YOURPASSWORDHERE by a password which will later be used by Bob to authenticate against Alice. I’d use a password with 20 or more characters, but that is up to you. Now go into Bob and edit
/ffp/var/opt/uwmirrorfolderrsync/uwmirrorfolderrsyncpass where you need to replace
YOURSERVERPASS by the same password.
The source-folder on Alice needs to be configured now. Currently this is “
/mnt/HD/HD_a2/Foo” which is probably different from your desired folder. Change this in the File
The target-folder on Bob is currently
/mnt/HD/HD_a2/Bar which can be reconfigured in
BACKUPDIR). Change this to the desired folder on Bob
Start the rsync-server on Alice:
sh /ffp/start/rsyncd.sh start
And run a test on Bob:
Normally the first run on Bob should be ok, errors will be displayed and are most of the time more or less obvious.
If the test-runs are completed sucessfully, the rsync-server on Alice will be switched on permanentely and on Bob a cronjob is created which runs the script every day on 03:00 and 15:00. If you want different times, just edit /ffp/start/uwmirrorfolderservice.sh for your convenience.
chmod a+x /ffp/start/rsyncd.sh
chmod a+x /ffp/start/uwmirrorfolderservice.sh /ffp/start/uwmirrorfolderservice.sh start
Thats it. For questions or remarks or just a “Thank you!” please leave a comment below.