{"id":156,"date":"2013-06-03T21:16:41","date_gmt":"2013-06-03T21:16:41","guid":{"rendered":"https:\/\/notiz.comanet.xyz\/?p=156"},"modified":"2019-03-03T19:42:30","modified_gmt":"2019-03-03T18:42:30","slug":"thecus-n5200-nsinc-rsinc-2","status":"publish","type":"post","link":"https:\/\/notiz.comanet.xyz\/?p=156","title":{"rendered":"Thecus N5200 NSinc &#8211; RSinc"},"content":{"rendered":"<p> \t<img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-154\" alt=\"\" src=\"https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/06\/uml-putty-ssh.png\" style=\"width: 666px; height: 413px;\" width=\"666\" height=\"413\" srcset=\"https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/06\/uml-putty-ssh.png 666w, https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/06\/uml-putty-ssh-300x186.png 300w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/p>\n<p> \t&nbsp;<\/p>\n<p> \tSSH<\/p>\n<p> \tDefault user: sys<br \/> \tDefault password: sys<br \/> \t&nbsp;<\/p>\n<p> \tEditor<\/p>\n<p> \tvi&nbsp; <a href=\"http:\/\/www.computerhope.com\/unix\/uvi.htm\">Manual Link<\/a> Exstern<\/p>\n<p> \tvi <a href=\"http:\/\/comanet.ddns.net\/notizjoomla\/index.php?option=com_content&amp;view=article&amp;id=114:vi-editor-manual&amp;catid=15&amp;Itemid=134\">Manual Link<\/a> Intern<\/p>\n<p> \t&nbsp;<\/p>\n<p> \tComand pokrenuti na TARGET :<\/p>\n<pre>\/raid\/data\/module\/RSYNC\/system\/bin\/rsync -a --delete --stats 192.168.1.30::Storage \/raid\/data\/Storage <\/pre>\n<p> \t&nbsp;<\/p>\n<p> \tCommand ubaciti u CRON :<\/p>\n<pre>00 *\/6 * * * \/raid\/data\/module\/RSYNC\/system\/bin\/rsync -a --delete --stats 192.168.1.30::Storage \/raid\/data\/Storage &gt;&gt; \/raid\/data\/Storage\/logfiles\/rsync.log<\/pre>\n<p> \t&nbsp;<\/p>\n<p> \t<a href=\"https:\/\/notiz.comanet.xyz\/wp-content\/uploads\/2013\/06\/Thecus_N4100_Nsync_Quick_Guide_2008-08-18.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">Thecus N4100 Nsync Quick Guide 2008-08-18<\/a><\/p>\n<p> \t&nbsp;<\/p>\n<p> \tOK, heres a little HowTo:<br \/> \tYou need at least following modules: SSHD, SYSUSER for ssh access and RSYNC for the rsync stuff.<br \/> \tInstall and enable SSHD and SYSUSER module. Change immediate the password of the user sys via the module property page of the SYSUSER module.<\/p>\n<p> \tInstall, but don&#39;t enable the RSYNC module.<br \/> \tNow select the source of Your data &#8211; in my case it is the N7700.<br \/> \tLogin 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)<br \/> \tHere how the file looks on my N7700 (at least a part of it):<\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">####################################################################### ## ## \/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<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \tThe only thing I have modified is the hosts allow to the IP adress of my N5200 &#8211; the target.<\/p>\n<p> \tNow enable the RSYNC module on Your source &#8211; in my case the N7700.<\/p>\n<p> \tLogout from the source and log on via ssh to the target.<br \/> \tIf 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 &#8211; I have decided to sync all source folders to a folder called NAS_BACKUP.<\/p>\n<p> \tIt&#39;s time for a first test now. With following command I sync my Public folder from the source N7700 to the target N5200<\/p>\n<p> <\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">\/raid\/data\/module\/RSYNC\/system\/bin\/rsync -a --delete --stats 192.168.7.5::Public \/raid\/data\/NAS_BACKUP\/Public\/<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \tThe 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.<\/p>\n<p> \tIf You test it I would choose a Test folder or a folder with a small number of files.<\/p>\n<p> \tIf it works it&#39;s time to enter this in the cron to run it automatically.<br \/> \tFor this modify the file \/app\/cfg\/crond.conf with Your entry. My entry looks following:<\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">00 *\/6 * * * \/raid\/data\/module\/RSYNC\/system\/etc\/copy_all.sh &gt;&gt; \/raid\/data\/NAS_BACKUP\/rsync.log 2&gt;&amp;1<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \tThe 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 &#8211; here a part of the script:<\/p>\n<p> <\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">#!\/bin\/bash # # called by cron to backup the N7700 to the N5200 via rsync echo &quot;start backup via rsync : `date`&quot; echo &quot;syncing folder : Public&quot; \/raid\/data\/module\/RSYNC\/system\/bin\/rsync -a --delete --stats 192.168.7.5::Public \/raid\/data\/NAS_BACKUP\/Public\/ echo &quot;syncing folder : Special&quot; \/raid\/data\/module\/RSYNC\/system\/bin\/rsync -a --delete --stats 192.168.7.5::Special \/raid\/data\/NAS_BACKUP\/Special\/ echo &quot;end backup via rsync : `date`&quot; echo &quot;+++++++++++++++++++++++++++++++++++++++++++++++++&quot;<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \tFor updating the real cron entries do following command:<\/p>\n<p> <\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">crontab \/app\/cfg\/crond.conf -u root<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \tThe log file looks following:<\/p>\n<p> <\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">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 +++++++++++++++++++++++++++++++++++++++++++++++++<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \tThats it &#8211; 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.<\/p>\n<p> \t&nbsp;<\/p>\n<hr \/>\n<p> \t&nbsp;<\/p>\n<p> \tThe RSYNC module have to be enabled on the source and also the config file has to be modified on the source.<br \/> \tOn the target N7700 &#8211; thats the one which holds the backups, theres no need to enable the module, just install it.<\/p>\n<p> \tLet&#39;s assume You have defined on Your source N7700 &#8211; thast the one You want to backup a Folder called [Test] in the configfile (don&#39;t forget to disabel\/enable the module after modifying the onfig file and You want to sync it to a Folder called &quot;Test&quot; 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:<\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">\/raid\/data\/module\/RSYNC\/system\/bin\/rsync -a --delete --stats 192.168.7.5::Test \/raid\/data\/Test<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \tplease replace 192.168.7.5 with the IP adress of Your source N7700.<\/p>\n<p> \trsync is always triggered from the target and the source listens for requests.<\/p>\n<p> \t&nbsp;<\/p>\n<hr \/>\n<p> \t&nbsp;<\/p>\n<p> \tOh sorry &#8211; first enter it on the commandline &#8211; if it works, then put in in cron.<br \/> \tFor this modify the file \/app\/cfg\/crond.conf with Your entry.<\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">00 *\/6 * * * \/raid\/data\/module\/RSYNC\/system\/bin\/rsync -a --delete --stats 192.168.7.5::Test \/raid\/data\/Test &gt;&gt; \/raid\/data\/logfiles\/rsync.log<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \tAfter modyfing the above mentioned file You have to run following command:<\/p>\n<p> <\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">crontab \/app\/cfg\/crond.conf -u root<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \tto update cron.<br \/> \tFrom now on Your command runs every 6 hours and writes to a log file named rsync.log in a folder called &quot;logfiles&quot; &#8211; this folder should have been created before.<\/p>\n<p> \t&nbsp;<\/p>\n<hr \/>\n<p> \t&nbsp;<\/p>\n<p> \tjust wanted to add &#8212; how much BETTER rsync is than either of the nsync options<\/p>\n<p> \tafter getting rsync to work &#8212; for me, on a 50gB folder of Documents<\/p>\n<p> \t1. NSYNC &#8212; synchronize &#8212; puts the whole folder each time, no changes &#8212; Hour each time<\/p>\n<p> \t2. NSYNC &#8212; incremental &#8212; puts only the changes, but takes forever to &#39;look&#39; at each file &#8212; 30 mins each time<\/p>\n<p> \t3. RSYNC &#8212; looking only for changes &#8212; once synced up, the next time it ran, took only &#8212; 5 seconds ! amazing<\/p>\n<p> \tthanks again PETER, you saved us here in the studio<\/p>\n<hr \/>\n<p> \t&nbsp;<\/p>\n<p> \tOf course, that depends on the entries of the crontab entry &#8211; the crontab entry is this one:<\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">00 *\/6 * * * \/raid\/data\/module\/RSYNC\/system\/bin\/rsync -a --delete --stats 192.168.7.5::Test \/raid\/data\/Test &gt;&gt; \/raid\/data\/logfiles\/rsync.log<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \twhat You have put in the \/app\/cfg\/crond.conf file &#8211; for the time definition the first enries are important:<\/p>\n<p> <\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">00 *\/6 * * *<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \ta monthly entry could look like:<\/p>\n<p> <\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">15 14 1 * *<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \twhich means : every first day of the month at 14:15<br \/> \ta weekly entry could look like:<\/p>\n<p> <\/p>\n<div class=\"bbcode_container\">\n<div class=\"bbcode_quote\">\n<pre class=\"quote_container\">5 4 * * 7<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p> \twhich means, runs every sunday at 04:05<br \/> \tYou have a lot of freedom to define at what time the job runs &#8211; see here for a description of the entries:<br \/> \t<a href=\"http:\/\/linux.die.net\/man\/5\/crontab\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/linux.die.net\/man\/5\/crontab<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; SSH Default user: sys Default password: sys &nbsp; Editor vi&nbsp; Manual Link Exstern vi Manual Link Intern &nbsp; Comand pokrenuti na TARGET : \/raid\/data\/module\/RSYNC\/system\/bin\/rsync -a &#8211;delete &#8211;stats 192.168.1.30::Storage \/raid\/data\/Storage &nbsp; Command ubaciti u CRON : 00 *\/6 * * * \/raid\/data\/module\/RSYNC\/system\/bin\/rsync -a &#8211;delete &#8211;stats 192.168.1.30::Storage \/raid\/data\/Storage &gt;&gt; \/raid\/data\/Storage\/logfiles\/rsync.log &nbsp; Thecus N4100 Nsync Quick Guide&#8230;<\/p>\n","protected":false},"author":1,"featured_media":154,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-156","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-network"],"_links":{"self":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts\/156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=156"}],"version-history":[{"count":1,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":408,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/posts\/156\/revisions\/408"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=\/wp\/v2\/media\/154"}],"wp:attachment":[{"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notiz.comanet.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}