{"id":150,"date":"2017-02-20T11:01:40","date_gmt":"2017-02-20T10:01:40","guid":{"rendered":"http:\/\/owncloud.gonscak.sk\/?p=150"},"modified":"2017-02-20T11:01:40","modified_gmt":"2017-02-20T10:01:40","slug":"rsync-review-and-some-examples","status":"publish","type":"post","link":"https:\/\/www.gonscak.sk\/?p=150","title":{"rendered":"Rsync review and some examples"},"content":{"rendered":"<p>rsync \u2014 a fast, versatile, remote (and local) file-copying tool<br \/>\n-a\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0archive mode<br \/>\n-r\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0recursive &#8211; recurse into directories<br \/>\n-v \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0verbose &#8211; increase verbosity<br \/>\n-z\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0compress &#8211; With this option, rsync compresses the file data as it is sent to the destination machine, which\u00a0 reduces the amount of data being transmitted something that is useful over a slow connection Note\u00a0 that\u00a0 this\u00a0 option typically achieves better compression ratios than can be achieved by using a compressing remote shell or a compressing transport because it takes advantage of the implicit information in the matching data blocks that are not explicitly sent over the connection<br \/>\n-P\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0is equivalent to &#8211;partial &#8211;progress.\u00a0 Its purpose is to make it\u00a0 much\u00a0 easier\u00a0\u00a0\u00a0\u00a0 to\u00a0 specify these two options for a long transfer that may be interrupted<br \/>\n-n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0perform a trial run with no changes made<br \/>\n-u\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0skip files that are newer on the receiver<br \/>\n-t\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0preserve modification times<br \/>\n&#8211;bwlimit=KBPS\u00a0\u00a0 \u00a0limit I\/O bandwidth; KBytes per second<br \/>\nThis option allows you to specify a maximum transfer rate in kilobytes per second.\u00a0 This\u00a0 option\u00a0 is\u00a0 most effective\u00a0 when using rsync with large files (several megabytes and up). Due to the nature of rsync transfers, blocks of data are sent, then if rsync determines the transfer was too fast,\u00a0 it\u00a0 will\u00a0 wait\u00a0 before<br \/>\nsending\u00a0 the next data block. The result is an average transfer rate equaling the specified limit. A value of zero specifies no limit.<br \/>\n(25Mb = 3200 KB)<br \/>\n(10Mb = 1250 KB)<br \/>\n(7.5 Mb = 960 KB)<br \/>\n(5Mb = 640 KB)<br \/>\n(2.5Mb = 320 KB)<br \/>\n(3Mb = 384 KB)<br \/>\n(1Mb = 128 KB)<br \/>\n&#8211;append \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0append data onto shorter files<br \/>\n&#8211;append-verify\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0append w\/old data in file checksum<\/p>\n<pre>rsync -avz foo:src\/bar \/data\/tmp<\/pre>\n<p>This\u00a0 would\u00a0 recursively\u00a0 transfer all files from the directory src\/bar on the machine foo into the \/data\/tmp\/bar directory on the local machine. The files are transferred in \u201carchive\u201d mode, which ensures that\u00a0 symbolic\u00a0 links,<br \/>\ndevices, attributes, permissions, ownerships, etc. are preserved in the transfer.\u00a0 Additionally, compression will be used to reduce the size of data portions of the transfer.<br \/>\n&#8211; Trailing slash on the source avoid to create directory on the destinations. So without trailing slash at the end, this will<br \/>\ncreate this directory at the destination. This is the same<\/p>\n<pre>\u00a0rsync -av \/src\/foo \/dest\n\u00a0rsync -av \/src\/foo\/ \/dest\/foo<\/pre>\n<p>This will synchronize and copy left folder to to right. It preserve unfinished files. With next commenad, it will resume<br \/>\nand append data to unfinished files.<\/p>\n<pre>rsync -avP \/mnt\/nfs \/media\/adm-nfs\/\nrsync -avP --append \/mnt\/nfs \/media\/adm-nfs\/<\/pre>\n ","protected":false},"excerpt":{"rendered":"<p>rsync \u2014 a fast, versatile, remote (and local) file-copying tool -a\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0archive mode -r\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0recursive &#8211; recurse into directories -v \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0verbose &#8211; increase verbosity -z\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0compress &#8211; With this option, rsync compresses the file data as it is sent to the destination machine, which\u00a0 reduces the amount of data being &hellip; <a href=\"https:\/\/www.gonscak.sk\/?p=150\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Rsync review and some examples<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[22,8,23],"class_list":["post-150","post","type-post","status-publish","format-standard","hentry","category-centos","tag-bwlimit","tag-linux","tag-rsync"],"_links":{"self":[{"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=\/wp\/v2\/posts\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=150"}],"version-history":[{"count":0,"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=\/wp\/v2\/posts\/150\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gonscak.sk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}