Stupid hotplug/usb drive/timestamp question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-
: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux