General discussion

Locked

I need a script to delete log files

By Patrick Horn ·
I have never written a script and have been tasked with writing one to delete log files. Here is the info I can supply for help. It is in a windows server environment. I would like to set it up as a scheduled task to run once a month. The script must look at log files in a folder on the server and delete any that are older than 3 months. My boss would prefer that it be a command line script, or it can also be a vb script, that is what I'm trying to teach myself. any help would be appreciated. Thanks.

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Patrick Horn In reply to I need a script to delete ...

What I am trying to delete are Sharepoint logs. They are getting out of hand and are starting to take over needed server space.

Collapse -

by easyprit In reply to I need a script to delete ...

If it's MS proprietary software, there shouldn't be a need to do any scripting.
Try this:
http://www.microsoft.com/technet/prodtechnol/sppt/reskit/c2961881x.mspx

I'm "assuming" there's a control tab somewhere, that you can use to set the usage for log files.

Collapse -

by Patrick Horn In reply to

Unfortunately, the whole point of the excercise is to understand and learn to write scripts. Thanks though.

Collapse -

by Toivo Talikka In reply to I need a script to delete ...

I have posted a couple of .bat or .cmd scripts in recent times, here is one:

http://techrepublic.com.com/5208-11196-0.html?forumID=51&threadID=179436

Earlier today (before seeing your question) I polished the second script, which is suitable for your situation, and added it with comments to my website at
http://totaldata.biz/techtips/batchfile.html.

The scripts were tested on Windows XP but should work on W2K, too.

Collapse -

by Patrick Horn In reply to

Poster rated this answer.

Collapse -

by Patrick Horn In reply to I need a script to delete ...

This question was closed by the author

Collapse -

I need the same script which you have asked above

by madhavi.bandhineni In reply to I need a script to delete ...

Please send me the script if you have

Back to Windows Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums