Page 1 of 1

Restore rsync backup with original timestamps?

Posted: 31 May 2011, 18:41
by Cheeseboy
Sorry, not really a bubba question:

I've been a very foolish boy, and lost 98% of my home directory.
Luckily I have only lost a few days due to regular rsync backups. The backups where made with the -av switch, and seems to retain the original file timestamps, but when I try to restore them, I can't figure out how to make the restored copy get the timestamps back, they all reset to the time of the restore.

Any ideas?

/Cheeseboy (hiding in shame behind his 3g modem)

EDIT:
Trying again with -I -t

Re: Restore rsync backup with original timestamps?

Posted: 31 May 2011, 19:07
by RandomUsername
Hi,

I just pulled down a couple of files via rsync to test this and all the files kept their original mtimes. I only used -avh on the rsync command.

My test situation was pretty standard - rsync over SSH to an ext4 drive (not sure about the source, not in my control).

Could it be to do with the file systems or protocols in use? Or possibly permissions? What's your situation exactly?

Darren.

Re: Restore rsync backup with original timestamps?

Posted: 31 May 2011, 19:18
by Cheeseboy
Hi Darren,

I panicked of course.
I used ls -lct and expected it to reflect the wrong date...

Thanks for your reply!

Now I only have to put the internet plug in again and start postfix and see if my email is corrupt or not :-)
...And all was hunky dory, did not lose a single email.

Re: Restore rsync backup with original timestamps?

Posted: 01 Jun 2011, 14:47
by Ubi
if you can rsync one way and keep the time stamps, why not rsync the other way with the exact same switches ?

Re: Restore rsync backup with original timestamps?

Posted: 01 Jun 2011, 15:05
by Cheeseboy
Hi Ubi,

Please see above:
I panicked of course.

Re: Restore rsync backup with original timestamps?

Posted: 01 Jun 2011, 15:13
by RandomUsername
Meaning he was using

Code: Select all

ls -lct
which shows ctime rather than mtime.