Acronis Access Advanced - Administrator's Guide Benutzerhandbuch

Seite 91

Advertising
background image

91

Copyright © Acronis International GmbH, 2002-2014

Info: Informationen zu ForFiles einschließlich Befehlssyntax und Beispielen finden Sie unter

http://technet.microsoft.com/de-de/library/cc753551(v=ws.10).aspx

http://technet.microsoft.com/de-de/library/cc753551(v=ws.10).aspx

Ein Beispielverfahren:

Das unten beschriebene Beispielverfahren automatisiert den Prozess des Bereinigens von Logdateien,

die älter sind als eine bestimmte Anzahl von Tagen. In der Beispiel-Batchdatei ist diese Zahl als

Parameter definiert und kann daher für unterschiedliche Aufbewahrungsrichtlinien angepasst

werden.

Info: Die Beispielskriptdatei (Batchdatei) ist für Windows 2008 konzipiert. Klicken Sie hier, um das Skript

herunterzuladen.

Sie können das Skript auf Wunsch auch kopieren, in ein leeres Textdokument einfügen und unter

'AASTomcatLogPurge.bat' speichern.
Klicken Sie hier für den vollständigen Code das Batch-Skripts...

ECHO OFF

REM Script: aETomcatLogsPurge.bat

REM 2012-05-12: Version: 1.0: MEA: Created

ECHO This script will delete files older than a number of days from a directory

ECHO Run it from the command line or from a scheduler

ECHO Make sure the process has permissions to delete files in the target folder

REM ===== CONFIGURATIONS ===================================================

REM Note: all paths containing spaces must be enclosed in double quotes

REM Edit this file and set LogPath and NumDays below

REM Path to the folder where all Tomcat logs are

set LogPath="C:\Program Files (x86)\Group Logic\Common\apache-tomcat-7.0.34\logs"

REM NumDays - Log files older than NumDays will be processed

set NumDays=14

REM ===== END OF CONFIGURATIONS ======================

ECHO

ECHO ===== START ============

REM ForFiles options:

REM "/p": the path where you want to delete files.

REM "/s": recursively look inside other subfolders present in the folder

mentioned in the batch file path

REM "/d": days for deleting the files older than the present date. For instance

"/d -7" means older than 7 days

REM "/c": command to execute to actually delete files: "cmd /c del @file".

Advertising