Backup file not deleting

  • @ sqlbuddy

    I am backing just 1 database into a folder, that is the one which is not getting deleted.

    btw, the extension for the deletion should be bak or .bak ??

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • @ steve

    There is only option of report to a text file in the mainteneance plan which i pasted earlier.

    In the job properties there is option of write to the windows application event log..which is unselected by me.

    I am using sql 2005, maybe there diff in sql 2000.

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • @jeffrey

    The two tasks r connected such as ... if the backup succeeds then the maintenenace plan should clean up older files.

    The directory in maintenenace plan is the same as specified in the backup folder.

    The extension should be bak or .bak??

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • are you copying your old day backup file to some other location?

    Try in task manager and if you can find any process which could be using your old day file. Kill that and try to rename your file. If you able to rename, you will be able to delelte.

    ----------
    Ashish

  • @ ashish

    No, im not copying the db, I m directly backing up the database to that destination.

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • and are you able to delete/rename it manually? If not then file is in use? Have you looked into your task manager?

    ----------
    Ashish

  • @ ashish

    Ya, I have to delete it manually everyday.

    I am able to delete it.

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • try to change maintenance plan to delete last 2 days file its 1 day as of now or just add one more day. And then once it run successfully on its next 2 schedule then change it back to original.

    Other option is

    put some sql script to delete the file instead of maintenance plan.

    ----------
    Ashish

  • Maybe you have the checkbox to "Create subdirectory for each database" checked in your backups, but dont have the "check subdirectories" checkbox checked for the cleanup task?

    Test this way: create directory that doesnt contain any "real" backup files, then create a file there called test.bak. Create a maintenance cleanup task to delete files over 1 minute old or something like that.... Set detailed logging to a text file for the maintenance task and execute it. If there's a problem deleting files, then you'll get an error message.

  • SKYBVI (9/6/2010)


    @jeffrey

    The two tasks r connected such as ... if the backup succeeds then the maintenenace plan should clean up older files.

    The directory in maintenenace plan is the same as specified in the backup folder.

    The extension should be bak or .bak??

    Regards,

    Sushant

    The extension cannot have the period in it - it should be bak and not .bak.

    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

  • Open up the task and click the button to view the SQL - copy/paste that back here so we can see how it is setup.

    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

  • @ ashish

    Yes, i can try that...

    @NJ-DBA

    In the backup task, the create subdirectory checkbox hasn't been checked

    In the cleanup task, the folder which is mentioned in the backup task is same mentioned there

    I did what u specified, i got the job successful but the bak file was nt deleted, i tried many times

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • for the record, I said that in the first reply to this post... (bak, not .bak)

  • @ jeffrey

    EXECUTE master.dbo.xp_delete_file 0,N'\\server_name\Priya',N'bak',N'09/05/2010 12:21:24'

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • I made new maintenance plan with only maintenace cleanup task

    and speciifed the location and put a dummy bak file

    I ran tht job and then it was successful but the bak file wasnt deleted:(

    i tried many times

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

Viewing 15 posts - 16 through 30 (of 44 total)

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