{"id":982,"date":"2020-08-01T23:42:49","date_gmt":"2020-08-01T23:42:49","guid":{"rendered":"http:\/\/www.tech-g.com\/?p=982"},"modified":"2020-08-01T23:45:15","modified_gmt":"2020-08-01T23:45:15","slug":"using-rsync","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2020\/08\/01\/using-rsync\/","title":{"rendered":"using rsync"},"content":{"rendered":"\n<p>rsync is better than mv to move files because of a few reasons<\/p>\n\n\n\n<p>First, it gives you much more control, for example the following command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rsync -a -v --ignore-existing --remove-source-files \/hds\/iscsi\/all_new \/hds\/usb<\/pre>\n\n\n\n<p>Does not copy the files that are already at destination, meaning if there is a file with the same name in the same directory at the destination, it will not be overwritten, files moved will be deleted, and files that had counterparts and not moved will not be deleted<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rsync -a -v --remove-source-files \/hds\/iscsi\/all_new \/hds\/usb<\/pre>\n\n\n\n<p>While the command above will overwrite files, and delete whatever we have moved ! if files exist on the destination, it does not seem to be overwriting them, but it is probably somehow comparing them, then deleting the original<\/p>\n\n\n\n<p>I had to investigate this as a move command resulting in an error did not remove the files, the error was relevant to the file name being too long<\/p>\n","protected":false},"excerpt":{"rendered":"<p>rsync is better than mv to move files because of a few reasons First, it gives you much more control, for example the following command rsync -a -v &#8211;ignore-existing &#8211;remove-source-files \/hds\/iscsi\/all_new \/hds\/usb Does not copy the files that are already at destination, meaning if there is a file with the same name in the same [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-982","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=982"}],"version-history":[{"count":4,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/982\/revisions"}],"predecessor-version":[{"id":986,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/982\/revisions\/986"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}