Maintenance plan problem - how to delete a specific .bak file

  • Hi,

    We want to delete non transactional databases backup after oneday. I used Maintenance cleanup task for each databases individually (delete specific file option), so that we can traverse to the folder S:\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\DB1Archive\*.bak, But its failing. I am not sure, I can use *.bak here. ????.

    Error :failed with the following error: "xp_delete_file() returned error 2, 'The system cannot find the file specified.'". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    If I use, search folder and delete file based on extension option and If I give *.bak, it also deleted all the backups including trasactional backup after 1 day, which we would like to keep for 3 days.

    How do I achieve seperately for transactional and non-transactional using maintenance plans ?

    Thank you,

    -V

  • I think I got it !!!

    Search for folder and delete specific file option , folder S:\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\DB1Archive , file extensio bak

    and uncheck the traverse sub folder

    Let me know, if this not correct...Thanks for looking !!!

    -V

  • I would setup a separate backup task for each "type" (transaction vs. non-transaction) of database and put them in different folders. Then, you can setup two cleanup tasks to traverse their sub-folders and set the retention for each cleanup task to one or three days as desired.

  • Thanks for your suggestion Jim..

    Thats how we did also..we keep transaction Db maintenance plan to keep backup for 3 days and we have non-transactional Db maintenance plan to keep backup for one day...But I had problem with the deletion, *.bak will delete all of them..I had a seperate cleanup task for each Db, but it doesn't like *.bak at the specific file option, which is strange though...

    Thanks,

    -V

Viewing 4 posts - 1 through 3 (of 3 total)

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