среда, 7 июня 2017 г.

Windows server: logs auto cleanup

To set up automatic cleanups

Step-by-step guide

.bat file will do it for you
  1. Create txt file
  2. Copy/paste command into it
  3. Schedule Batch File

  4. Make sure it has admin permissions!

forfiles -p "C:\*******\ProgramLogs" -s -m ECS.log.* /D -5 /C "cmd /c del @path"

File filter is:

ECS.log files (ECS.log.*),

older than 5 days (-5)





To check all big files in windows use this (cmd as administrator!):
forfiles /S /M * /C "cmd /c if @fsize GEQ 104857600 echo @path"

Комментариев нет:

Отправить комментарий

Bash: MySql backup (file per db), restore+ users and privileges

Backup Mysql DB (file per db) #!/bin/bash USER="root" databases=`mysql -u $USER -e "SHOW DATABASES;" | tr -d "|...