waRmZip is een Windows script file dat ervoor kan zorgen dat je logfiles of temp directory automatisch worden opgeschoond. Het script kan (bepaalde) bestanden ouder dan X dagen automatisch verplaatsen, verwijderen of comprimeren.
Onderstaand script zorgt ervoor dat bestanden ouder dan 30 dagen worden verwijderd uit de map “ C:\Testdir\Subdir”.
Door een /r (recursive) erachter te plaatsen zullen ook de subfolders worden doorgelopen.
===============================================
@echo off
set waRmZip="c:\Scripts\waRmZip\waRmZip.wsf"
set DirC2D="c:\Testdir\Subdir"
rem Delete files older than 30 days in DirC2D (geen subfolders)
%waRmZip% %DirC2D%\ /da:30 /q
================================================
Hieronder de parameters die je kunt gebruiken:
waRmZip.wsf v1.7 (Nov 2005)
Utility to clean up/free up space in a folder (and its subfolders),
* compressing files after a certain number of days (with external program)
* rotating files after a certain number of days/above a certain size
* deleting files and/or empty folders after a certain period of time
* moving files to other folders/disks
___________________________________________
Usage: waRmZip.wsf BASE [/ca:value] [/cp:value] [/cpp:value] [/ce:value]
[/da:value] [/dc] [/df] [/dr] [/ma:value] [/md:value] [/mb] [/ra:value]
[/rn:value] [/rp:value] [/fo:value] [/fn:value] [/gt:value] [/lt:value]
[/r] [/nh] [/t] [/v] [/q] [/log:value]
Options:
- BASE : base folder where cleanup starts
- /ca : compress files after X days
- /cp : compress program - command line
- /cpp : compress program - command parameters
- /ce : compressed file extension
- /da : delete files after X days
- /dc : delete compressed files too after X days
- /df : delete empty folders - only when /r is used
- /dr : delete read-only files/folders
- /ma : move files after X days
- /md : move files to this folder (can be local or UNC)
the following keywords are substituted:
$YEAR: YYYY, $MONTH: YYYYMM, $DAY: YYYYMMDD, $HOUR: HH, $COMP: COMPUTERNAME, $WEEKDAY: 1-7
e.g: /md:F:\backup\$COMP\logfiles\$DAY - /mb : backup mode - do not delete file after moving
- /ra : rotate files after X days (creation date!)
- /rn : rotate & create new empty file after rotation
- /rp : rotation prefix - D:YYYYMMDD
- /fo : filter only - only process files with extension
- /fn : filter not - don’t process files with extension
- /gt : greater than- only process when larger than
- /lt : lesser than - only process when smaller than
- /r : recursive - also process subfolders
- /nh : no hidden - do not process hidden files/folders
- /t : test mode - don’t actually process files - just show what would be done
- /v : verbose - show debug output during execution
- /q : quiet - no output during execution log
- /logfile - write output to file
if filename=’D’ use [script name].YYYYMMDD.log as log file
if filename=’M’ use [script name].YYYYMM.log as log file
if no filename given use [script name].log as log file
Geen opmerkingen:
Een reactie posten