Include Page | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
...
- Retention parameters:
-keep
= minimum number of log files to keep in all cases (default = 3, minimum = 1)- Overrides the next 2 parameters
- Keeps the most recent ones
-daysarc
= number of days to keep the log files before archiving (zipping) them (default = 35 days)- The script will look for all log files with
.log
extension, older than "daysarc
" days, and will zip them (if possible)
- The script will look for all log files with
-daysdel
= number of days to keep the log and zipped files before deletion (default = 90 days)- The script will look for all log files with
.log
and.zip
extension, older than "daysdel
" days, and will delete them (if possible). The script will:- delete all zipped files older than "
daysdel
" days in case they have been zipped thanks to the "daysarc
" parameter above - delete all log files older than "
daysdel
" days in case they have not been zipped (either too old, unzipped manually or if version of PowerShell is below 5.1)
- delete all zipped files older than "
- Value must be greater than "
daysarc
". If this is not the case, the script will:- display a warning message,
- force the value to be "
daysarc + 7
" and continue
- The script will look for all log files with
-install =
installation mode as a scheduled job (see chapter "Scheduled task mode583663691" below)
- Others:
-ini <file>
= optional configuration file (see below) containing customized values for the retention parameters (keep
,daysarc
,daysdel
). Please note if retention parameters are passed, they will overwrite the file content.-help
= display usage information
...
Scheduled task mode
The script prtovides provides an auto-installer to create a scheduled job that will run each day at 1:00 AM.
...
|
...