1

Can anyone recommend a utility that can scan specified directory locations (network shares specifically) and return all files older than a certain date?

I am looking to implement a data retention policy at my workplace. As our amount of data grows it puts a large strain on our backup routines. I would like to move old data to some sort of archival system.

Extra points for the ability to move queried old files to another location for archival and the ability to create schedules for when this occurs.

Many thanks.

EDIT: Windows Shop. Mostly Windows 2003 Servers.

In this particular case, this isn't mission critical data. Just various user documents on network shares. The archival system would simply be to move old data to a removable device off site once a month. Most data will most likely never be accessed again but I would like at least one copy to disk as opposed to simply deleting it.

CT.
  • 741
  • 2
  • 8
  • 20

3 Answers3

2

forfiles would work as well.

forfiles -p *path to your files* /s /m *.* /d -30 /c "cmd /c xcopy @path *\destination\@file "
Tsynapse
  • 316
  • 1
  • 3
  • I like installing cygwin and running "find", but forfiles is an excellent native answer. – mfinni Jun 16 '10 at 19:28
  • @mfinni: try unixutils (http://sourceforge.net/projects/unxutils/) much more light weight than cygwin. – Zypher Jun 16 '10 at 20:25
  • I have other uses for Cygwin though. Like an X Server. I also found that some of the unxutils didn't always behave in the same way as the GNU standard(s) - I don't recall the specifics, but it bit me in the butt a handful of times. – mfinni Jun 16 '10 at 20:33
  • putting cygwin on a production server however opens up all sorts of security issues and other problems. Why put cygwin on when windows already has an entire unix subsystem? – Jim B Jun 16 '10 at 23:06
  • Who said word one about putting cygwin on a server? The OP was asking about network shares, and you can run find or forfiles just as easily from a client machine as the server. And if you have an intern or admin ass't doing it, they better not be on the server. But there are decent reasons to go with Cygwin instead of SFU/SUA. One is SSH. Another is an X server (as I said.) From a workstation point of view, there's no competition- Cygwin has dozens (hundreds?) of packages ready-to-go. SUA doesn't include emacs :-) And what security issues are you referring to, with Cygwin? – mfinni Jun 17 '10 at 01:28
1

PowerShell can be used for that. here is a sample:

$Cutoffdate = (Get-date).AddDays(-30)
Get-Childitem –recurse \\server\share\folder | where-object {$_.lastwritetime –gt $Cutoffdate}
Stephane
  • 6,432
  • 3
  • 26
  • 47
0

Honestly, you'll probably spend more time hacking an archival system together than it's worth. New backup systems are not that expensive; and you need to evaluate what you're data is worth.

Don't forget that you're time is money spent on the system, and that generally adds up very quickly (more so after you add employment tax to your normal hourly rate). Business that are "too cheap to buy new equipment" generally are not seeing the true costs.

Chris S
  • 77,945
  • 11
  • 124
  • 216
  • He's talking about data retention policies, not archiving system. – Stephane Jun 16 '10 at 13:51
  • He's talking about revising what is backed-up in the guise of an archival system: "As our amount of data grows it puts a large strain on our **backup routines**. I would like to move old data to some sort of archival system." Also, data retention policies are about what needs to be backed-up, for how long, and when it needs to be deleted; nowhere did he mention separating data that needs to be keep for different amounts of time. – Chris S Jun 16 '10 at 13:54
  • In this particular case, this isn't mission critical data. Just various user documents on network shares. The archival system would simply be to move old data to a removable device off site once a month. Most data will most likely never be accessed again but I would like at least one copy to disk as opposed to simply deleting it. – CT. Jun 16 '10 at 14:21