Mainenance cleanup task is not working properly

  • We have a maintenance plan which takes backup to the network path.

    It selected the option create a sub-directory for each database.

    I added maintenace cleanup task and selected include first-level sufolders but looks it is not deleting the older files.

  • Provided you have permission to the remote folder (check your logs); what file extension did you specify? It needs to match the files you intend to delete. Also check the file age option, obviously if it's set for a long period it could be awhile before the files are deleted.


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • Yes. Has the access also the job never failed.

    First backup then cleanup the files older than 3 days Extension is bak

  • Please check that the file extension is configured to bak and not .bak - I have made this mistake before and it will prevent the cleanup from working properly.

  • Looks it is working but not sure why some databases has 3 backup files and some are 4 days backup files when I use the retention period delete older than 3 days

  • ramana3327 (3/16/2016)


    Looks it is working but not sure why some databases has 3 backup files and some are 4 days backup files when I use the retention period delete older than 3 days

    If you're only running the command once at the beginning of the backup run, this is quite possible because the later backups will not yet be old enough when you issue the delete command. It's all a matter of timing.

    Also, deleting backups at the beginning can and will be a big problem for you someday. You should never delete a backup until you are sure that you've just created a good backup. Otherwise, if something goes wrong, you could end up with no backups when you can least afford to.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Cleanup task is after running after the backup

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

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