Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


GrahamG
2008-10-14T12:08:52Z

Is it possible to set a task to delete files older than a specific date ? I am running 4.2.26. If not, could this be added.


Thanks


Graham
Sponsor
Forum information
ErikC
2008-10-14T13:03:01Z
Hi GrahamG,

If you click here  you can see there is already feature request of it.

Regards,
Erik
Uses Visualcron since 2006.
GrahamG
2008-10-15T09:28:03Z
Thanks Eric,

I thought I'd seen something but then couldn't find a mention on the forum. Also had a feeling it had been implemented.

Any timecales on this support ?


Thanks in advance


Graham
Support
2008-10-15T09:34:06Z
The reason why we have waited with this is because it will be a breaking change. Old Tasks won't work unless you have set it right. There is no good way of migrating from old Tasks and you have to respecify paths. Also, you won't be able to go back easily without re-applying settings. While we are doing this we will change some paths and names of the service etc. which will make this even more "final".

But, back to time, it will be some day this year. Hopefully in November.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Mark Johnson
2008-10-29T14:29:10Z
Graham,

I am also waiting for this feature as well. For right now, I am doing this two different ways. One with a batch script calling a PERL program and one calling a VB script. Here is the VB script I found on the web a few years ago I am using to delete any files older then 3 days on one of my servers:

Option Explicit
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
DeleteFiles fso.GetFolder("C:\FACSys\Queue") '<----- Change this folder name to match with your case.
Sub DeleteFiles(srcFolder)
Dim srcFile
If srcFolder.Files.Count = 0 Then
Wscript.Echo "No File to Delete"
Exit Sub
End If
For Each srcFile in srcFolder.Files
If DateDiff("d", Now, srcFile.DateCreated) < -3 Then '<----- Change this value to how many days old you want to test for. This example looks for 3 days old or -3.
fso.DeleteFile srcFile, True
End If
Next
Wscript.Echo "Files Deleted successful"
End Sub

Works great. The VB script name should end with .vbs like "deleteold.vbs". Here is how I execute the vb script:

I first create a batch file "deleteold.bat". In the bat file I put the following:

CD C:\WINNT\system32
wscript C:\deleteold.vbs //B

Then do a command line task in VisualCron calling the bat file.

I hope this helps!!

-Mark
Scroll to Top