{"id":360,"date":"2019-02-01T23:07:09","date_gmt":"2019-02-01T23:07:09","guid":{"rendered":"http:\/\/www.wis.co.uk\/blog\/?p=360"},"modified":"2019-02-05T22:07:23","modified_gmt":"2019-02-05T22:07:23","slug":"cygwin-and-the-unreadable-files","status":"publish","type":"post","link":"https:\/\/www.wis.co.uk\/blog\/cygwin-and-the-unreadable-files","title":{"rendered":"Cygwin and the unreadable files"},"content":{"rendered":"<p>I have a PC which has been upgraded from Windows 7 to Windows 10. At some point during one of the upgrades, some accounts have been &#8220;upgraded&#8221;. It all looks seamless until you take a look with Cygwin, which I use to make some backups.<\/p>\n<p>And herein lies the problem.<\/p>\n<pre style=\"font-size: small;\">$ ls -l\nd---r-xrwx+ 1 Unknown+User Unknown+Group       0 Apr  6  2014 '2007 Photos'\nd---r-xrwx+ 1 Unknown+User Unknown+Group       0 Apr  6  2014 '2008 Photos'\nd---r-xrwx+ 1 Unknown+User Unknown+Group       0 Apr 28  2014 '2009 Photos'\nd---r-xrwx+ 1 Unknown+User Unknown+Group       0 Jun 12  2014 '2010 Photos'\ndrwxr-xrwx+ 1 Andy         None                0 Apr 28  2018 '2011 Photos'\nd---r-xrwx+ 1 Unknown+User Unknown+Group       0 Nov 23  2014 '2012 Photos'\nd---r-xrwx+ 1 Unknown+User Unknown+Group       0 Mar 23  2016 '2013 Photos'\nd---r-xrwx+ 1 Unknown+User Unknown+Group       0 Dec 30  2014 '2014 Photos'\ndrwxr-xrwx+ 1 Andy         None                0 Jan 28 20:46 '2015 Photos'\ndrwxr-xrwx+ 1 Andy         None                0 Sep 24  2017 '2016 Photos'\ndrwxr-xrwx+ 1 Andy         None                0 Apr 28  2018 '2017 Photos'\ndrwxr-xrwx+ 1 Andy         None                0 Jan  9 16:58 '2018 Photos'\ndrwxr-xrwx+ 1 Andy         None                0 Jan  9 16:48 '2019 Photos'<\/pre>\n<p>All the above are really owned by user &#8220;Andy&#8221;, and have been since 2007, but somewhere along the line, maybe in a Win10 upgrade, they&#8217;be been re-owned by the operating system.<\/p>\n<p>This is now a problem when I back up using a shell-script in Cygwin because I was using rsync<\/p>\n<pre style=\"font-size: small;\">rsync -avz \"${SOURCE_ROOT}\/${DIR}\/\" \"${REMOTE_USER}@${REMOTE_ADDR}:\\\"${DEST_ROOT}\/${DIR}\\\"\"<\/pre>\n<p>This used to work, but now it doesn&#8217;t because the <tt>-a<\/tt> flag to rsync includes the instruction to<br>copy file permissions. which<\/p>\n<p>A little look in the manual reminds me that <tt>-a<\/tt> is a combination of other<br>flags (<tt>-rlptgoD<\/tt>), and that includes the <tt>-p<\/tt> flag meaning &#8220;copy file permissions&#8221;. So<br>my rsync command now looks like this:<\/p>\n<pre style=\"font-size: small;\">rsync -rltovz<\/pre>\n<p>I did also find a way of seeing these strange owners in Windows, but it was quite hidden: Right click on the folder in question and click &#8220;Properties&#8221;, then look in the &#8220;Sharing&#8221; tab:<\/p>\n<p>Who&#8217;s that &#8220;Unknown Contact&#8221;? I suspect that&#8217;s actually the GUID of the original &#8220;Andy&#8221; account.<\/p>\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/02\/strange-file-ownership-2.png\"><img loading=\"lazy\" width=\"300\" height=\"297\" src=\"https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/02\/strange-file-ownership-2-300x297.png\" alt=\"\" class=\"wp-image-434\" srcset=\"https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/02\/strange-file-ownership-2-300x297.png 300w, https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/02\/strange-file-ownership-2-150x150.png 150w, https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/02\/strange-file-ownership-2.png 723w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I have a PC which has been upgraded from Windows 7 to Windows 10. At some point during one of the upgrades, some accounts have been &#8220;upgraded&#8221;. It all looks seamless until you take a look with Cygwin, which I &hellip; <a href=\"https:\/\/www.wis.co.uk\/blog\/cygwin-and-the-unreadable-files\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,13,14],"tags":[40,41,38],"_links":{"self":[{"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/posts\/360"}],"collection":[{"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=360"}],"version-history":[{"count":18,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/posts\/360\/revisions"}],"predecessor-version":[{"id":440,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/posts\/360\/revisions\/440"}],"wp:attachment":[{"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}