1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unable to set atime or mtime of directories

Discussion in 'Cisco/Linksys Network Storage Devices' started by scene24, Dec 16, 2006.

  1. scene24

    scene24 LI Guru Member

    Is it possible to set the access time and modification time of a directory on the NSLU2 to an arbitrary value?

    I have the NSLU2, and wanted to copy the contents of DISK 1 to DISK 2, preserving the access and modification times.

    I'm on a MAC, so I thought the Unix 'cp' command would be able to do it, like this:

    % cp -Rp /Volumes/DISK\ 1/* /Volumes/DISK\ 2

    But all the copies ended up with access and modification times that reflected the time that the copy was made.

    I tried using the backup utilities native to the NSLU2, but when it was all done, only the files had the preserved atimes and mtimes. The directories were all brand new.

    I thought I could just use a script to copy each file and directory, and then set the atime and mtime to match the original using 'touch', but 'touch' does not seem to be able to affect the directories. This works for directories on the built-in drive, but not on the drives attached to the NSLU2.

    Is there some reason that the NSLU2 does not allow directories' atime and mtimes to be set?

Share This Page