Piper Posted December 18, 2008 Share Posted December 18, 2008 I have searched and right now we are set up to delete all by the click of a button ..How ever i was wondering if there was a script that would enable us to schedule this task ? Because it would also eliminate the need for a restart script since the "game application/server" reboots when the logs get deleted . All and any help in this matter is greatly appreciated . Thank you . Link to comment Share on other sites More sharing options...
studeggle Posted December 18, 2008 Share Posted December 18, 2008 Task scheduler Link to comment Share on other sites More sharing options...
Derek Posted December 19, 2008 Share Posted December 19, 2008 Would be nice to post the script here, for we can take a look at it. Link to comment Share on other sites More sharing options...
studeggle Posted December 19, 2008 Share Posted December 19, 2008 They said they were already setup to delete log files just not on a schedule and the answer for that is Windows task scheduler. TcAdmin doesn't have a task scheduler built into it, and there realy isn't any need for one iether. As for deleting files I use the following script, altering the location as pertinent. Option Explicit Dim fso Set fso = CreateObject("Scripting.FileSystemObject") DeleteFiles fso.GetFolder("C:\userfiles\rugunno\tc.......") Sub DeleteFiles(srcFolder) Dim srcFile If srcFolder.Files.Count = 0 Then Exit Sub End If For Each srcFile in srcFolder.Files If DateDiff("d", Now, srcFile.DateCreated) < -30 Then fso.DeleteFile srcFile, True End If Next End Sub This script also utilizes a time delay allowing me to have log rotation, and if I don't wish to retain any logs I just set the time delay to nothing. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.