SSH
Default user: sys
Default password: sys
Editor
vi Manual Link Exstern
vi Manual Link Intern
Comand pokrenuti na TARGET :
/raid/data/module/RSYNC/system/bin/rsync -a --delete --stats 192.168.1.30::Storage /raid/data/Storage
Command ubaciti u CRON :
00 */6 * * * /raid/data/module/RSYNC/system/bin/rsync -a --delete --stats 192.168.1.30::Storage /raid/data/Storage >> /raid/data/Storage/logfiles/rsync.log
Thecus N4100 Nsync Quick Guide 2008-08-18
OK, heres a little HowTo:
You need at least following modules: SSHD, SYSUSER for ssh access and RSYNC for the rsync stuff.
Install and enable SSHD and SYSUSER module. Change immediate the password of the user sys via the module property page of the SYSUSER module.
Install, but don't enable the RSYNC module.
Now select the source of Your data – in my case it is the N7700.
Login via ssh to the N7700 and modify the file /raid/data/module/RSYNC/system/etc/rsyncd.conf (the file is created with default values and all Your shares in it)
Here how the file looks on my N7700 (at least a part of it):
####################################################################### ## ## /raid/data/module/RSYNC/system/etc/rsyncd.conf - RSYNCD config file ## ####################################################################### gid = users read only = true transfer logging = false log file = /var/log/rsyncd.log pid file = /var/run/rsyncd.pid hosts allow = 192.168.7.6 [Public] comment = Public Files path = /raid/data/Public read only = no list = yes uid = sys gid = nogroup
The only thing I have modified is the hosts allow to the IP adress of my N5200 – the target.
Now enable the RSYNC module on Your source – in my case the N7700.
Logout from the source and log on via ssh to the target.
If You wish to have a exact copy of Your source on the target, then You have to create all top level folders which You want to sync via the Web Interface – I have decided to sync all source folders to a folder called NAS_BACKUP.
It's time for a first test now. With following command I sync my Public folder from the source N7700 to the target N5200
/raid/data/module/RSYNC/system/bin/rsync -a --delete --stats 192.168.7.5::Public /raid/data/NAS_BACKUP/Public/
The IP adress in the above commandline is the IP adress of my N7700 and I sync the folder Public (which is defined in the rsyncd.conf file of the source N7700) to the top level folder NAS_BACKUP and there into a subfolder Public.
If You test it I would choose a Test folder or a folder with a small number of files.
If it works it's time to enter this in the cron to run it automatically.
For this modify the file /app/cfg/crond.conf with Your entry. My entry looks following:
00 */6 * * * /raid/data/module/RSYNC/system/etc/copy_all.sh >> /raid/data/NAS_BACKUP/rsync.log 2>&1
The cron calls every 6 hours the script copy_all.sh (this is a simple script with all rsync commands and some echo commands) and redirects all outputs to a log file – here a part of the script:
#!/bin/bash # # called by cron to backup the N7700 to the N5200 via rsync echo "start backup via rsync : `date`" echo "syncing folder : Public" /raid/data/module/RSYNC/system/bin/rsync -a --delete --stats 192.168.7.5::Public /raid/data/NAS_BACKUP/Public/ echo "syncing folder : Special" /raid/data/module/RSYNC/system/bin/rsync -a --delete --stats 192.168.7.5::Special /raid/data/NAS_BACKUP/Special/ echo "end backup via rsync : `date`" echo "+++++++++++++++++++++++++++++++++++++++++++++++++"
For updating the real cron entries do following command:
crontab /app/cfg/crond.conf -u root
The log file looks following:
start backup via rsync : Mon May 25 18:00:02 CEST 2009 syncing folder : Public Number of files: 15535 Number of files transferred: 0 Total file size: 804895522908 bytes Total transferred file size: 0 bytes Literal data: 0 bytes Matched data: 0 bytes File list size: 505518 File list generation time: 0.001 seconds File list transfer time: 0.000 seconds Total bytes sent: 1073 Total bytes received: 509421 sent 1073 bytes received 509421 bytes 340329.33 bytes/sec total size is 804895522908 speedup is 1576699.28 syncing folder : Special Number of files: 57 Number of files transferred: 0 Total file size: 17383696900 bytes Total transferred file size: 0 bytes Literal data: 0 bytes Matched data: 0 bytes File list size: 1494 File list generation time: 0.001 seconds File list transfer time: 0.000 seconds Total bytes sent: 35 Total bytes received: 1556 sent 35 bytes received 1556 bytes 3182.00 bytes/sec total size is 17383696900 speedup is 10926270.84 end backup via rsync : Mon May 25 18:00:04 CEST 2009 +++++++++++++++++++++++++++++++++++++++++++++++++
Thats it – from now on Your source is synced every 6 hour to the target. Be aware that deleted files on the source are also deleted on the target with the above rsync options.
The RSYNC module have to be enabled on the source and also the config file has to be modified on the source.
On the target N7700 – thats the one which holds the backups, theres no need to enable the module, just install it.
Let's assume You have defined on Your source N7700 – thast the one You want to backup a Folder called [Test] in the configfile (don't forget to disabel/enable the module after modifying the onfig file and You want to sync it to a Folder called "Test" on Your target N7700 (the one which holds the backups) the You have to login in Your target N7700 via ssh and issue following command:
/raid/data/module/RSYNC/system/bin/rsync -a --delete --stats 192.168.7.5::Test /raid/data/Test
please replace 192.168.7.5 with the IP adress of Your source N7700.
rsync is always triggered from the target and the source listens for requests.
Oh sorry – first enter it on the commandline – if it works, then put in in cron.
For this modify the file /app/cfg/crond.conf with Your entry.
00 */6 * * * /raid/data/module/RSYNC/system/bin/rsync -a --delete --stats 192.168.7.5::Test /raid/data/Test >> /raid/data/logfiles/rsync.log
After modyfing the above mentioned file You have to run following command:
crontab /app/cfg/crond.conf -u root
to update cron.
From now on Your command runs every 6 hours and writes to a log file named rsync.log in a folder called "logfiles" – this folder should have been created before.
just wanted to add — how much BETTER rsync is than either of the nsync options
after getting rsync to work — for me, on a 50gB folder of Documents
1. NSYNC — synchronize — puts the whole folder each time, no changes — Hour each time
2. NSYNC — incremental — puts only the changes, but takes forever to 'look' at each file — 30 mins each time
3. RSYNC — looking only for changes — once synced up, the next time it ran, took only — 5 seconds ! amazing
thanks again PETER, you saved us here in the studio
Of course, that depends on the entries of the crontab entry – the crontab entry is this one:
00 */6 * * * /raid/data/module/RSYNC/system/bin/rsync -a --delete --stats 192.168.7.5::Test /raid/data/Test >> /raid/data/logfiles/rsync.log
what You have put in the /app/cfg/crond.conf file – for the time definition the first enries are important:
00 */6 * * *
a monthly entry could look like:
15 14 1 * *
which means : every first day of the month at 14:15
a weekly entry could look like:
5 4 * * 7
which means, runs every sunday at 04:05
You have a lot of freedom to define at what time the job runs – see here for a description of the entries:
http://linux.die.net/man/5/crontab