js479
asked on
Automatically delete files based on last accessed time
I'm looking for a way to automatically delete files from our SAN based on last accessed time. SAN vendor doesn't have a method to do this but suggested a program called Delete Files by Date Software. I attempted to test this software but they don't offer any trial period, you can download and view files but in order to test it's functionality you must purchase a license, so while I was uninstalling that waste of time I decided to ask the experts.
I had also tried a program called Delenda, which seems to do what I want but doesn't seem to work. I pointed it at a directory (12k files, 3.5GB) and let it run for 24 hours with no progress.
So what I need is a decent program that can run automatically (as a service preferably) that can delete files based on their last accessed time.
Any suggestions?
I had also tried a program called Delenda, which seems to do what I want but doesn't seem to work. I pointed it at a directory (12k files, 3.5GB) and let it run for 24 hours with no progress.
So what I need is a decent program that can run automatically (as a service preferably) that can delete files based on their last accessed time.
Any suggestions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As I said, the syntax varies between the different platforms, the examples I provided above are for Linux under CentOS. Make sure to consult the man pages to be sure if you use this.
ASKER
My apologies for not being more specific in the original question.
The SAN is creating CIFS shares that we can connect to via our windows machines. So the SAN is called DC-BA-01 and I create a CIFS share called Work, I can then access and map that CIFS share from any of my windows servers using \\DC-BA-01\work. All of our servers are either windows 2003 or 2008.
The SAN is creating CIFS shares that we can connect to via our windows machines. So the SAN is called DC-BA-01 and I create a CIFS share called Work, I can then access and map that CIFS share from any of my windows servers using \\DC-BA-01\work. All of our servers are either windows 2003 or 2008.
The san is then running a linux based os with samba shares.
Do you have an option to run jobs on the SAN?
If you are a windows shop, you would use vbscript and fileobject to traverse the directoreis looking at each files atime.
There are many examples of using VBscript to list files in directories, etc. that you can use and incorporate into a script that you need to run as a scheduled task to delete these files.
A simple search for "vbscript list files in directory" will provide several examples.
Using the vbscript guide for fileobject access will provide info on how to use it to access the access time, modify time, create time of the file and then compare and perform action on the file as you see fit.
Do you have an option to run jobs on the SAN?
If you are a windows shop, you would use vbscript and fileobject to traverse the directoreis looking at each files atime.
There are many examples of using VBscript to list files in directories, etc. that you can use and incorporate into a script that you need to run as a scheduled task to delete these files.
A simple search for "vbscript list files in directory" will provide several examples.
Using the vbscript guide for fileobject access will provide info on how to use it to access the access time, modify time, create time of the file and then compare and perform action on the file as you see fit.