linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Stupid hotplug/usb drive/timestamp question
@ 2006-04-11  6:35 Dave
  0 siblings, 0 replies; only message in thread
From: Dave @ 2006-04-11  6:35 UTC (permalink / raw)
  To: linux-admin

Hopefully somebody can give me a shortcut to the answer to my problem, as I'm 
a bit overwhelmed trying to read up on udev, hotplug, usbfs, HAL, fstab-sync, 
etc.

I recently got an external, USB-connected box for an IDE drive, which I'm now 
using as my backup drive with a script derived from Mike Rubel's rsync 
snapshots (http://mikerubel.org/computers/rsync_snapshots/index.html).  
Briefly, it uses mv to rename daily.(n) to daily.(n+1) for all n from 0 to 
the highest existing, uses cp to make a hardlink copy from daily.1 to 
daily.0, and then uses rsync to update only changed files in daily.1.

It worked fine when the destination was on an internal drive, i.e. connected 
to the mobo IDE controller.  "ls -l" showed each numbered backup folder 
(daily.0, daily.1, daily.2, etc...) with timestamp it was created, no matter 
how many times it was moved up from daily.n to daily.n+1.

Now that I'm using the USB drive, it seems each time a folder is renamed, the 
timestamp changes to the current time.  This makes it a tad difficult to know 
how old each backup is when they all have the same timestamp, from when the 
script last ran.

I did a quick check, and for a filesystem mounted on /dev/hda3 (my root 
filesystem) "mv oldname newname" preserves attributes, including timestamp.  
On the usb drive, "mv oldname newname" changes the timestamp.

Why?  And how do I fix this?  The mountpoint is dynamically created 
in /etc/fstab when the usb drive is turned on; currently it looks like

/dev/sda1   /media/backups   ext2   pamconsole,exec,noauto,managed 0 0

All I want is for ls -l to show each folder with the correct timestamp.  I 
know that each folder is a day older than the previous ... but it's the 
principle.  Plus, once I get this debugged, I'm going to share the drive 
read-only for my wife via Samba, so she can restore her own files when she 
accidentally deletes something

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-11  6:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-11  6:35 Stupid hotplug/usb drive/timestamp question Dave

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).