On Sun, 17 Feb 2013 11:38:16 +0000 Michael Dorrington michael.dorrington@gmail.com allegedly wrote:
On 15/02/13 12:29, mick wrote:
internally all my data from the old disk to the new. In doing so (using something like "cp -r /old-disk/micks-stuff /new-disk/micks-stuff") like a pillock I forgot to add the -p switch so all my files now have a current date/time as last modified. Guess what? My latest rsync now
For that sort of copying I recommend using the '-a' option aka '--archive'. Even better might be to use a streaming tar 'tar -c... | tar -x ...' or similar with cpio or just rsync. Just read the manuals and be careful of the gotchas such as symlinks, sparse files, very long file names, device files, ...
cpio? obviously an old unix hand....
On 15/02/13 19:29, mick wrote:
I may just have to recopy all the source files from disk to disk using the -p switch to cp so that the file time stamps are maintained. That way the NAS won't see all the source files as being newer next time I kick off the rsync.
You just need to fix the timestamps so take a look at 'find' and 'touch'. For 'find' look at the '-exec' option and '{}'. For 'touch' look at '--reference=', ' --no-dereference', and '--no-create' options. The rest is left as an exercise for the reader. :)
Actually after Wayne's earlier response (and a bit more thought) I did consider just touching all the NAS files so that they had a later timestamp than my (new) desktop source. I think that should have solved the rsync update problem. But what I actually ended up doing was re-copying from the old disk to new (which didn't take all that long). What I didn't say in my earlier email (because it wasn't relevant) was that I have an anoracky reason of my own for wanting to keep the original file modification times.
I have a very large collection of MP4 video files I have ripped from my DVDs. This collection dates back to 2007 when I first started watching such videos on a PSP on my daily commute to and from London. Over the years since, I have updated the PSP to an Archos 4.3, and Archos 7.0, and latterly a Samsung Galaxy tab. The original PSP was very finicky about the format of the files, and of course had a small screen. Now whilst my latest device can still happily display my old 320x240 and 368x208 rips, it can handle much higher resolutions encoded in H264. So my later files have different encoding standards.
Now that I have more time on my hands I keep promising myself that I will re-encode the older files originally ripped for the PSP. The file modification time helps me identify those files pretty quickly.
Of course, whether I now bother to do that given that my commuting days are over is another matter.
Thanks
Mick ---------------------------------------------------------------------
blog: baldric.net gpg fingerprint: FC23 3338 F664 5E66 876B 72C0 0A1F E60B 5BAD D312
---------------------------------------------------------------------