enjay Posted March 31, 2011 Posted March 31, 2011 Thanks Plexer, not too familiar with robocopy scripts though, so would you mind typing out the whole command line I'd need?
Cools Posted March 31, 2011 Posted March 31, 2011 so you need /MINAGE:20070901 ((YYYYMMDD) That's "1st sep 2007" i put) added to current robocopy command line and remove /MINAGE:365 looks simple enough
2097 Posted March 31, 2011 Posted March 31, 2011 Looks like a good command ! . I have quite a few drives i can do that on Many thanks .. Ill try it in the easter breaks
plexer Posted March 31, 2011 Posted March 31, 2011 (edited) hmm should have pasted this bit too: (If n < 1900 then n = n days, else n = YYYYMMDD date). Cools: except it would be /MINLAD:20070901 Ben Edited March 31, 2011 by plexer
plexer Posted March 31, 2011 Posted March 31, 2011 Also if staff say they want a whole folder keeping but can't be sure everything has been accessed within your specified timeframe you could use touch.exe - touch for Windows to touch the files for you. Ben
enjay Posted March 31, 2011 Posted March 31, 2011 @cools - I was meaning the /minlad and /maxlad which Plexer posted above, as I think those are better. IMHO, age of file doesn't denote importance of file - there are some vital old files and some useless new files. If I want to identify files which haven't been accessed since a particular date, is that minlad:date or maxlad:date?
Cools Posted March 31, 2011 Posted March 31, 2011 hmm 1900 non of my staff member are that old but then again.... lol
Cools Posted March 31, 2011 Posted March 31, 2011 Well My "staffarea" with (robocopy.exe "d:\Staffarea" "K:\Shared\From-Bigbang-to-2009\Staff" *.* /S /COPYATSO /MOVE /ZB /NP /XA:RHS /XF *.ini *.ico /MINAGE:730 /R:2 /W:10) set to 730 days moved over 51GB of old files. Still got staff personal folders to do.. lol.. might user last access time for that...
plexer Posted March 31, 2011 Posted March 31, 2011 enjay: if you wanted to keep files in your staff share that had been accessed since the 1st January 2009 you would use /MINLAD:20090101 - I think You can always run robocopy with just the list option and the log it as well this will show you what it would do without moving anything. Or if you omit /move it will just do a copy and not delete the source files. Ben
Cools Posted March 31, 2011 Posted March 31, 2011 sorry i did not mean /MINAGE:... what i meant was /MINLAD: as Plexer corrected me on.. we have to look at 2 things: 1. Space wasted from files never accessed for more then 2 years and the cost of space on SAS. (and also WAV files and WMV to MPEG that can be compressed) 2. We are only archiving not deleting as you may have to keep the data for a number of years. I see it better to archive files not access more then 2years "from there last access date" and hard backup to a data storage device usb/nas/Whatever for fast access if you need to.
enjay Posted March 31, 2011 Posted March 31, 2011 So, to make sure I've got this straight: robocopy.exe "d:\Staffarea" "K:\Shared\From-Bigbang-to-2009\Staff" *.* /S /COPYATSO /MOVE /ZB /NP /XA:RHS /XF *.ini *.ico /MINLAD:730 /R:2 /W:10 That will run through and find every file which hasn't been accessed for the last 730 days and move it from the folder in D: to the one in K:, retaining the folder structure? Sounds perfect. Where would I specify the list option to check this before running it?
enjay Posted March 31, 2011 Posted March 31, 2011 Okay, I'll give it a whirl on a test area and then if that is successful, run it network-wide in the holidays. Cheers guys!
kennysarmy Posted March 31, 2011 Posted March 31, 2011 This worked for me: robocopy.exe "\\fp2\staff$" "E:\RArchive\UDrive" *.* /S /COPY:DATSO /ZB /NP /XA:RHS /XF *.ini *.ico *.jpg /MINLAD:20090901 /R:2 /W:10
Cools Posted March 31, 2011 Posted March 31, 2011 robocopy.exe "d:\Staffarea" "K:\Shared\From-Bigbang-to-2009\Staff" *.* /S /COPYATSO /MOVE /ZB /NP /XA:RHS /XF *.ini *.ico /MINLAD:730 /R:2 /W:10 change the /MINLAD:730 you the date format YYYYMMDD 20090901 the 730 is days ..
plexer Posted March 31, 2011 Posted March 31, 2011 Yes as it says if the number you use is less than 1990 then it means days do if you wanted to move all files that hadn't been accessed in the lst 2 years then you would use 730. Ben
kennysarmy Posted April 1, 2011 Posted April 1, 2011 Hmmm.... Something must have happened on my network in June 2009 as if I search for files in staff drives with access dates prior to /MINLAD:20090622 I hardly find any files at all.....but if I change it to /MINLAD:20090625 I find about 4 Gig of data.....so I conclude that something happened between these two dates that "accessed" a large number of files and changed the date stamp.....
enjay Posted April 1, 2011 Posted April 1, 2011 Did you change servers? All our files are dated August 2009, which is when we got our current server...
enjay Posted April 1, 2011 Posted April 1, 2011 How do you run this just as a search not a copy? I want to see the scale of the situation before selecting which date to use...
kennysarmy Posted April 1, 2011 Posted April 1, 2011 How do you run this just as a search not a copy? I want to see the scale of the situation before selecting which date to use... Logging options /L : List only - don't copy, timestamp or delete any files. /NP : No Progress - don't display % copied. /LOG:file : Output status to LOG file (overwrite existing log). /LOG+:file : Output status to LOG file (append to existing log).
enjay Posted April 1, 2011 Posted April 1, 2011 No joy here - it looks like the Last Access Date isn't getting updated when I open files. Any ideas?
kennysarmy Posted April 1, 2011 Posted April 1, 2011 I've also found a slight issue I think.... I ran the jobs without the /Move switch to copy files/folders to my local maching as a test. Now when I run the job with the /Move switch in place nothing gets copied - I can only assume the copy routine has accessed the files
Cools Posted April 1, 2011 Posted April 1, 2011 Try this line... robocopy.exe "d:\From" "X:\To" *.* /S /COPY:DATSO /MOVE /ZB /NP /XA:RHS /XF *.ini *.ico /MINLAD:20080901 /R:2 /W:10 i had the same problem i had to change /COPYATSO /MOVE to /COPY:DATSO /MOVE after i added /MINLAD:20080901
enjay Posted April 1, 2011 Posted April 1, 2011 I've removed the copy line altogether while testing, so that won't be it. My problem is that the "last accessed date" is wrong...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now