+ Post New Thread
Results 1 to 6 of 6
Scripts Thread, Script to archive data no accessed since X year in Coding and Web Development; Does anyone have an archiving scripts they could give me which can be used to archive everything within a folder ...
  1. #1
    mrbios's Avatar
    Join Date
    Jun 2007
    Location
    Stroud, Gloucestershire
    Posts
    2,584
    Thank Post
    368
    Thanked 269 Times in 221 Posts
    Rep Power
    101

    Script to archive data no accessed since X year

    Does anyone have an archiving scripts they could give me which can be used to archive everything within a folder that hasn't been accessed? (i need one that specifically goes by the last date accessed rather than modified)

    I'm assuming it'll be doable with robocopy, but I'm just not sure of the flags required. If someone could explain the setup of the script as well rather than just dumping a script on my lap that would be very appreciated

  2. #2

    Join Date
    Apr 2008
    Location
    UK
    Posts
    63
    Thank Post
    6
    Thanked 2 Times in 2 Posts
    Rep Power
    14
    I believe the MINLAD switch is minimum last accessed date. So for example:

    Robocopy "SourceFolder" "DestinationFolder" /E /minlad:365

    Would copy things that haven't been accessed for a year or older.

    Robocopy | SS64.com

  3. #3


    Join Date
    Sep 2008
    Posts
    1,821
    Thank Post
    338
    Thanked 262 Times in 214 Posts
    Rep Power
    120
    I've just been going through some of our shared files and have hit a bit of a snag (well bit more than that) I've just been informed that we have some software which has stopped working due to not being able to find some files. Now it turns out the reason is I've archived files which haven't been accessed for over 5 years which these files apparently haven't been. For some reason the last accessed time is the same as created but the modified date is much later (within the last month). Now I've got a problem as all the archived data I've moved based on last accessed time and now I'm not sure if this is accurate. Any ideas why the last accessed time is out?

  4. #4


    Join Date
    Sep 2008
    Posts
    1,821
    Thank Post
    338
    Thanked 262 Times in 214 Posts
    Rep Power
    120
    OK just realised I should have used minlad as outlined above for last modified date and not used minlad for last accessed date. Thats a whole new scripts I've got to update

  5. #5
    mrbios's Avatar
    Join Date
    Jun 2007
    Location
    Stroud, Gloucestershire
    Posts
    2,584
    Thank Post
    368
    Thanked 269 Times in 221 Posts
    Rep Power
    101
    ooo lots of my old threads being necrod today

    It's also worth noting that by default starting with server 2008R2 files in a share don't automatically update the last modified date. That was a snag i hit, seems there's a registry setting for it. (Note: I'm remembering something from a year ago, so that may not be entirely accurate, but it was along those lines)

  6. Thanks to mrbios from:

    penfold (8th April 2014)

  7. #6


    Join Date
    Sep 2008
    Posts
    1,821
    Thank Post
    338
    Thanked 262 Times in 214 Posts
    Rep Power
    120
    Quote Originally Posted by mrbios View Post
    ooo lots of my old threads being necrod today

    It's also worth noting that by default starting with server 2008R2 files in a share don't automatically update the last modified date. That was a snag i hit, seems there's a registry setting for it. (Note: I'm remembering something from a year ago, so that may not be entirely accurate, but it was along those lines)
    This is exactly what I am doing - archiving shared files. I'm now having to re-test my scripts and I assume I can use MINAGE & MINLAD as a switch so I can skip any files either Modified OR accessed within the last 5 years.



SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 1
    Last Post: 15th March 2013, 11:06 AM
  2. Script to copy file if accessed today
    By THERADIOTUBBY in forum Coding
    Replies: 3
    Last Post: 19th September 2010, 07:04 PM
  3. No access to LAN behind SonicWALL
    By jimothy in forum Wireless Networks
    Replies: 5
    Last Post: 28th April 2008, 02:18 PM
  4. Replies: 10
    Last Post: 16th February 2008, 08:47 PM
  5. Replies: 2
    Last Post: 16th January 2008, 05:25 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •