Results 1 to 2 of 2

Thread: Purging the old Transaction Log files

  1. #1
    Join Date
    Aug 2007
    Posts
    0

    Question Purging the old Transaction Log files

    Hi,

    In one of our DR Servers we have configured Custom Logshipping. In the folder where the .TRN files are getting copied there is a script to purge the files which are older than one day. Following is the code for the same.

    @Echo Off
    if exist filelist del filelist
    date /t > rundate
    for /f "tokens=2* delims= " %%i in (rundate) do set rundate=%%i
    for %%i IN (*.trn) do echo >> filelist %%i %%~ti
    for /f "tokens=1,2* delims= " %%i in (filelist) do if not %rundate% equ %%j del %%i
    ause
    :Exit

    Instead of removing the files older than 1 day, I need to keep 3 days transaction logs.

    Being a novice I don't have much idea how to accomlish it. Can anybody help me with this?

    Many thanks in advance,

    Sandhya

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Is it dos batch file? What's log backup file naming convention?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •