WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
Page Index Toggle Pages: 1
Use WD to move log files to Archive location (Read 2199 times)
Junior Member

Posts: 59
Use WD to move log files to Archive location
Sep 14th, 2005 at 7:16am
I would like to use WD to move log files, that are constantly updated by running apps, to a location for archive.
I would trigger WD to look at a location once a day and move the file, renaming it with a "filename_date_time.log" file name.

Is this possible?


Back to top
IP Logged
YaBB Administrator

Posts: 2259
The Netherlands
Re: Use WD to move log files to Archive location
Reply #1 - Sep 14th, 2005 at 8:16am
I don't think you need to use WD for that. Just create a .bat script that does the move and "schedule" it using the AT command or "scheduled tasks" (control panel).

The script would look something like this:

@echo off
move c:\logs\thelogfile.log "d:\archive\thelogfile_%date%.log"

if you get a lot of "file in use" errors when you use the above (because other processes are writing to it), you will need a loop to retry:

@echo off
move c:\logs\thelogfile.log "d:\archive\thelogfile_%date%.log"
if %errorlevel% neq 0 goto :TryAgain

Back to top

Gert Rijs - gert (at) gdpsoftware (dot) com
End Alzheimer's:
WWW WWW GdPSoftware  
IP Logged
Page Index Toggle Pages: 1