rpettit Posted June 30, 2011 Posted June 30, 2011 I am looking to create a script that will run on our file servers to remove any pictures older than a set modified date. Any help would be greatly appreciated.
CyberNerd Posted June 30, 2011 Posted June 30, 2011 find / -type f -iname "*.jpg" -mtime -7 | xargs /bin/rm -f removes jpgs older than 7 days
rpettit Posted June 30, 2011 Author Posted June 30, 2011 (edited) Is there a way to change the 'older than' to years instead of days? Just to add the Servers are 2008 R2 Edited June 30, 2011 by rpettit
CyberNerd Posted June 30, 2011 Posted June 30, 2011 just add +365 I think. you can run unix scripts on windows using cygwin
Flakes Posted June 30, 2011 Posted June 30, 2011 install robocopy, off the top of my head i dont know the command, however all the commands are here: Robocopy and theres a thread on edugeek with more info about robocopy
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