{"id":462,"date":"2011-01-28T00:30:38","date_gmt":"2011-11-22T21:51:50","guid":{"rendered":"http:\/\/kraftek.com\/blog\/copy-only-new-files\/"},"modified":"2011-01-28T00:30:38","modified_gmt":"2011-11-22T21:51:50","slug":"copy-only-new-files","status":"publish","type":"post","link":"\/blog\/index.php\/copy-only-new-files\/","title":{"rendered":"copy only new files"},"content":{"rendered":"<p>To make a differential copy, so you copy all files in \/a that are not in \/b, you can do:<br \/>\n# cd \/a<br \/>\n#\/usr\/local\/bin\/tar pcf &#8211; kraftek.html POSTS rescue rescued.html rescued.txt x y z | ( cd \/b; \/usr\/local\/bin\/tar kxfp &#8211; )<br \/>\nThe clue here is the &#8220;k&#8221; option, to keep existing files<br \/>\ncompare directories for missing files<br \/>\nSo you made a copy of \/a into \/b, but you see \/b has less files, how to know which files are missing in \/b x y z<br \/>\n# find \/a | sort &gt; as.txt<br \/>\n# find \/b | sort &gt; bs.txt<br \/>\n# comm -23 as.txt bs.txt<br \/>\nthe last command will show the files that are in \/a that are not in \/b<br \/>\nenjoy<br \/>\n192\/433<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To make a differential copy, so you copy all files in \/a that are not in \/b, you can do: # cd \/a #\/usr\/local\/bin\/tar pcf &#8211; kraftek.html POSTS rescue rescued.html rescued.txt x y z | ( cd \/b; \/usr\/local\/bin\/tar kxfp &#8211; ) The clue here is the &#8220;k&#8221; option, to keep existing files compare directories [&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-462","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=462"}],"version-history":[{"count":0,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"wp:attachment":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}