Contents
Is there a PowerShell script to delete log files?
We recently automated the process of logfile clean up by using a Powershell script that deletes files older than 90 days. The script was then placed in task scheduler to run nightly. The script was is a modified version of one found on the internet. The original source was pretty simple; we stripped it down even further.
How to delete old log files in Bash?
The way it works is very simple: you feed it a path/folder and a number of days and it deletes all the files in the given directory older than the number of days passed in. Ultimately it does something like this:
Is there a way to delete Windows server log files?
Windows servers can generate tons of log files on a daily basis. Managing those log files can be a chore. Ignoring the log files is not an option, as too many log files could fill up a hard drive. We recently automated the process of logfile clean up by using a Powershell script that deletes files older than 90 days.
How to delete files in Unix using shell script?
I have the following task to perform using shell script. The user will provide a directory name along with a date. The script will delete all the files in the specified directory that was created earlier to that date. Also it should display the number of files that has been deleted.
How do I clean up the cleanup logs?
Right-click the file CleanupLogs.ps1 and click on Run with PowerShell. A PowerShell window will show up and the script is cleaning up the logs. Wait till the PowerShell window disappears from the screen. It means that the script finished. Have a look again at how much free space you have on the drive. See the after cleanup screen.
Where do I Delete my IIs log files?
IIS Log files write to the C:\\inetpub directory by default, you can change this to another drive etc. These files can be 200mb+ and overtime will use up space on the drive. To delete them open up the following location: Inside this folder, you will have 2 other folders namely W3SVC1 and W3SVC2.