Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Robocopy (or similar) to restore folder modified time after copy?

  • 08-11-2011 11:51pm
    #1
    Registered Users, Registered Users 2 Posts: 13,016 ✭✭✭✭


    I have about 5tb of data copied from one NAS to another and although the files themselves have the same 'last modified' timestamp, it has reset it to the time everything was copied for all of the folders, which is causing a bit of a headache.

    i still have the two copies of everything on both NAS's, but i feel like i should be able to fix the modified timestamp with robocopy or something similar, i just can't figure out how.

    has anyone dealt with this before? i've seen similar threads on it online, but nobody seems to have a solution that works on a large amount of data like this.

    i just need the modified times on the folders in the destination to be reset to that of the source.

    i want to avoid recopying everything, but if i have no other choice, can anyone recommend something to recopy everything over without changing the last modified timestamp on each folder that is created?

    both NAS's support rsync, but the source NAS is refusing to see the location on the root folder destination so i ended up using allway sync pro instead, which to be fair, did a good job aside from the folder timestamp thing. :(


Comments

  • Closed Accounts Posts: 1,188 ✭✭✭UDP


    Try using Richcopy instead of else maybe write a powershell or some other script to loop through each file/folder and change the date to that of the original source.


  • Registered Users, Registered Users 2 Posts: 13,016 ✭✭✭✭vibe666


    richcopy does the same thing, files are still original modified dates, but folders have the coy time as the modified date. :(

    and unfortunately, scripting is a bit outside of my area of expertise. :(


  • Closed Accounts Posts: 1,188 ✭✭✭UDP


    What about using a script like in this thread:
    http://www.powershellcommunity.org/Forums/tabid/54/aft/6028/Default.aspx
    It goes through and sets the last modified date to that of the last modified file in the folder.


  • Registered Users, Registered Users 2 Posts: 13,016 ✭✭✭✭vibe666


    UDP wrote: »
    What about using a script like in this thread:
    http://www.powershellcommunity.org/Forums/tabid/54/aft/6028/Default.aspx
    It goes through and sets the last modified date to that of the last modified file in the folder.
    awesome, i'll give it a go this evening, thanks. :)


  • Registered Users, Registered Users 2 Posts: 13,016 ✭✭✭✭vibe666


    i gave you an extra "thanks" there UDP on your other post as the powershell script worked, once I fixed the permissions on my new NAS, as all the folders were also set to read only and the NAS wouldn't let me change it.

    i took a bit of linux chmod'ing and chown'ing, but powershell did the trick after that, with the exception of only about half a dozen folders out of 1700+, and only because they didn't have files in them (just subfolders).

    thanks anyway, i can stop sweating now. :)


  • Advertisement
Advertisement