Delete .bak files from a remote server

  • Hi,

    I have maintenance plans running on 2 different servers and using it to backup the databases on other remote server. In the maintenance plan, I added the task of deleting older files everyday, but that is not working; everyday i have to manually delete the older files.

    It is sql 2005 enterpirse edition with sp3 and i also checked the sql agent rights to the folder which has the backup.

    So, I was thinking of running some automated windows script which would delete the .bak files everyday.

    Can anyone help in this regard.

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • In the Cleanup task did you enter .bak instead of bak as file extension?

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • @ pradeep

    Its bak

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • Are the files in the main folder or sub folders? Make sure the Agent does not have a proxy as well.

    I tend not to run this from a remote server, but I would likely set this to run from the local server where the backups are stored. However if you run a script, be sure that you are careful to note delete files unless there is a newer backup for that database.

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

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