Maint Routine ~ Backups ~ delete old backup files failing

  • Hi

    Ive got a couple of maint plans on a sever that I created using the wizard that just consist of create backups onece a day and delete anything older than 2 days... However the housekeeping part seems to be failign dismally 🙁

    I checked the history and it reports as completeing normally .. task detail shows

    Maintenance Cleanup on Local server connection

    Cleanup Database Backup files

    Age: Older than 2 Days

    view t-sql shows

    EXECUTE master.dbo.xp_delete_file 0,N''D:\DB_Backups\AM'',N''.bak'',N''2009-05-30T05:36:10''

    GO

    And yet backups with a date of "2009-05-30" still remain !??

    what is happening ?!

  • Are you having any files that are from 29th, check the time that you specify for deletion 🙂

  • The age works with exact dates and times without rounding. Take this case:

    Backups complete

    2009-05-01 20:00:10 ( 10 second after 8 PM)

    2009-05-03 20:00:00 ( at exactly 8 PM)

    Two days before the second backup is 2009-05-01 20:00:00 and the earlier backup time is NOT greater than that age timestamp.

    Specify the age in hours less a window such as 36 hours.

    SQL = Scarcely Qualifies as a Language

  • Ive got files in there from the 26th its happily ignoring.... 🙁

    changed it too files older than 2 hours....... still no joy !!

  • You have a dot in the extension (bak instead of .bak) - remove that and it will work.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Jeffrey Williams (6/1/2009)


    You have a dot in the extension (bak instead of .bak) - remove that and it will work.

    you are a star !!!

    many thanks

    ~simon

  • You are welcome - glad I could help.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply