Zoom7000 Posted February 3, 2015 Posted February 3, 2015 I have noticed that the server space on our Windows network is getting very low. So I have agreed with SLT to have a look to see if I can archive off files that haven't been accessed in over 2 years. Is it possible to write a script (maybe using Robocopy?) that will scan for files that haven't been accessed in 2 years, output the names and file paths to a text file, copy these files to an external hard drive and then delete them from the network? 2
fairm010 Posted February 3, 2015 Posted February 3, 2015 I have that exact script! robocopy.exe "F:\Share" "F:\Data\_ArchiveShare" *.* /S /COPY:DATSO /MOVE /ZB /NP /XA:RHS /XF *.ini *.ico /MINAGE:730 /R:2 /W:10 pause Run on the file server, altering the path names obviously. 4
jinnantonnixx Posted February 3, 2015 Posted February 3, 2015 (edited) Be careful, you're selecting file on their creation date, not the last access date. Robocopy can do this, use the MINLAD option. /MAXLAD:n : MAXimum Last Access Date - exclude files unused since n. /MINLAD:n : MINimum Last Access Date - exclude files used since n. (If n < 1900 then n = n days, else n = YYYYMMDD date). When testing, you'll want to use the /L option /L : List only - don’t copy, timestamp or delete any files. http://ss64.com/nt/robocopy.html Edited February 3, 2015 by jinnantonnixx 4
eyetea Posted February 3, 2015 Posted February 3, 2015 Will be approaching my LM / SLT regarding a similar thing here! Cheers all
Iain.Faulkner Posted February 3, 2015 Posted February 3, 2015 I wanted to do this on our file server for anything not accessed in the last 5 years and was told that everything on there was essential :-(
Zoom7000 Posted February 3, 2015 Author Posted February 3, 2015 Is there anyway I can get the file paths and file names to display to a TXT file?
fairm010 Posted February 3, 2015 Posted February 3, 2015 You could > dummyfile.txt at the end I think to out put the window to a .txt
3s-gtech Posted February 3, 2015 Posted February 3, 2015 Ah robocopy, the backbone of pretty much all of our backup and file move scripts. It is awesome.
jinnantonnixx Posted February 3, 2015 Posted February 3, 2015 Is there anyway I can get the file paths and file names to display to a TXT file? Plenty of options... You'll probably want /L with /LOG:logfile 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). /UNILOG:file : Output status to Unicode Log file (overwrite) ## /LOG+:file : Output status to LOG file (append to existing log). /UNILOG+:file : Output status to Unicode Log file (append) ## /TS : Include Source file Time Stamps in the output. /FP : Include Full Pathname of files in the output. /NS : No Size - don’t log file sizes. /NC : No Class - don’t log file classes. /NFL : No File List - don’t log file names. /NDL : No Directory List - don’t log directory names. /TEE : Output to console window, as well as the log file. /NJH : No Job Header. /NJS : No Job Summary. 1
Geoff Posted February 3, 2015 Posted February 3, 2015 I wanted to do this on our file server for anything not accessed in the last 5 years and was told that everything on there was essential :-( If you're getting this thrown back at you, you need to work out the costs of archiving vs online storage (I assume a SAN) per Mb. Then work out how much your growth rate is. Then work out how many you could potentially move to archive. Armed with this info you can go back say, "OK based on your decision I'll need £XXXX for a new san in Y years, unless you let me archive at rentintion time Z years in which case we can avoid spending that money for A years." 1
TechMonkey Posted February 3, 2015 Posted February 3, 2015 I wanted to do this on our file server for anything not accessed in the last 5 years and was told that everything on there was essential :-( So do it and if they complain restore from archive. If they don't notice it wasn't essential. Essential doesn't mean have to have it at my fingertips 24/7, just not deleted.
Zoom7000 Posted February 3, 2015 Author Posted February 3, 2015 So, I'm presuming that this is the script I need: robocopy.exe “” “” *.* /S /E /COPY:DATSO /MOVE /ZB /MINLAD:730 /R:2 /W:10 Notice the MINLAD - I think this is correct (/MINLAD:n : MINimum Last Access Date - exclude files used since n) So, in this case, /MINLAD:730 - Exclude files used in the last 730 days. Sound correct?
Hawkeyez Posted February 3, 2015 Posted February 3, 2015 I have tested (with the /L switch) and works. Got about 150GB of data in RMShared and RMStaff that hasn't been accessed since the migration of CC3 to CC4 in the Summer of 2013 (About 40% of space used) 1
Iain.Faulkner Posted February 3, 2015 Posted February 3, 2015 So do it and if they complain restore from archive. If they don't notice it wasn't essential. Essential doesn't mean have to have it at my fingertips 24/7, just not deleted. I've been categorically told I am not to move anything from the staff shared areas
Geoff Posted February 3, 2015 Posted February 3, 2015 I suggest you do the costing exercise I outlined. As a follow up if they flat refuse to do anything you have no choice but to implement quotas.
jmak Posted February 3, 2015 Posted February 3, 2015 I've been categorically told I am not to move anything from the staff shared areas Move to an external USB HDD, map with the same share name and make it read only - they won't notice and it you can take it out of your backup regime, making that quicker as well as recovering space on the server. 1
eyetea Posted February 18, 2015 Posted February 18, 2015 Is there a way to list files that includes their last access date & file size (filepath would be nice) to a .csv file so that I can sort it to present to my LM?
jmak Posted February 18, 2015 Posted February 18, 2015 Is there a way to list files that includes their last access date & file size (filepath would be nice) to a .csv file so that I can sort it to present to my LM? I was going to use treesize to point me in the right direction, but quickly discovered that it reported last change dates as more recent than last access dates. A quick Google suggested that this was to do with the way the OS reported details, rather than treesize. I'd therefore be a bit wary of using reported last access dates for archiving. Would be very happy to hear about a way to overcome this though... 1
timbo343 Posted February 18, 2015 Posted February 18, 2015 (edited) Have a look at this. It might help you out. Basically it quickly runs a report and exports to pdf. http://www.karenware.com/powertools/ptdirprn.asp Clean download link: http://download.cnet.com/Directory-Printer/3000-2094_4-50132.html Edited February 18, 2015 by timbo343
mb2k01 Posted February 18, 2015 Posted February 18, 2015 Have a look at this. It might help you out. Basically it quickly runs a report and exports to pdf. Karen's Directory Printer This gets flagged as malware by Chrome and then by Windows Defender / AV?
timbo343 Posted February 18, 2015 Posted February 18, 2015 (edited) Damm! That used to be a really good utility too! EDIT: Try this link, download.com's version is clean http://download.cnet.com/Directory-Printer/3000-2094_4-50132.html Edited February 18, 2015 by timbo343
penfold Posted February 18, 2015 Posted February 18, 2015 Just to raise an issue here as it was overlooked when I did this. We used last accessed date to archive files but then found out that at some point it was turned off on the server. The result was that for some files the last modified was being updated but the last accessed wasn't - resulting in current files being archived. Kind of put a stop to archiving by last accessed date.
mrbios Posted February 18, 2015 Posted February 18, 2015 Just to raise an issue here as it was overlooked when I did this. We used last accessed date to archive files but then found out that at some point it was turned off on the server. The result was that for some files the last modified was being updated but the last accessed wasn't - resulting in current files being archived. Kind of put a stop to archiving by last accessed date. I just came here to point out exactly that. It's something that came into play in 2008 or 2008R2 version of windows server, you have to actually turn on via a registry edit. Luckily i found this out after extensive testing before actually moving anything. Not sure if it still applies to 2012 and 2012R2, though i would assume so, and i doubt many/anyone here is still using 2003 for their file servers to not be affected by it.
MYK-IT Posted March 2, 2015 Posted March 2, 2015 (edited) Just to raise an issue here as it was overlooked when I did this. We used last accessed date to archive files but then found out that at some point it was turned off on the server. The result was that for some files the last modified was being updated but the last accessed wasn't - resulting in current files being archived. Kind of put a stop to archiving by last accessed date. I just came here to point out exactly that. It's something that came into play in 2008 or 2008R2 version of windows server, you have to actually turn on via a registry edit. Luckily i found this out after extensive testing before actually moving anything. Not sure if it still applies to 2012 and 2012R2, though i would assume so, and i doubt many/anyone here is still using 2003 for their file servers to not be affected by it. I experienced the same issue here too; (although majority of files did have different modified & last accessed datestamps) where I archived files (not accessed in 2+ years) off our live (2008) file server only for many departments stating files/folders had gone which were current and had been used within the past few weeks/months... In the interim, had to revert everything, and working on an alternative solution. Edited March 2, 2015 by MYK-IT
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