Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Restore rsync backup with original timestamps?

Got problems with your B2 or B3? Share and get helped!
Post Reply
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Restore rsync backup with original timestamps?

Post 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
RandomUsername
Posts: 904
Joined: 09 Oct 2009, 18:49

Re: Restore rsync backup with original timestamps?

Post 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.
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: Restore rsync backup with original timestamps?

Post 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.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Restore rsync backup with original timestamps?

Post by Ubi »

if you can rsync one way and keep the time stamps, why not rsync the other way with the exact same switches ?
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: Restore rsync backup with original timestamps?

Post by Cheeseboy »

Hi Ubi,

Please see above:
I panicked of course.
RandomUsername
Posts: 904
Joined: 09 Oct 2009, 18:49

Re: Restore rsync backup with original timestamps?

Post by RandomUsername »

Meaning he was using

Code: Select all

ls -lct
which shows ctime rather than mtime.
Post Reply