delete the backup file according to a definite date

  • Hello everyone
    To answer the need GDPR

     I must precede to delete the backup put on the sharing according to a date defined by my client

    for that I have as output a table which contains the path of the backup, the name of the backup and the date defines for the suppresion
    backuplink represents the physical path of the backup file

    With xp_cmdshell can I handle this type of request

    thank you for your help

  • You can use xp_cmdshell, but have you had a look at Ola Hallengren's scripts, these will do all this for you, you can even set up retention period in hours.

    https://ola.hallengren.com

  • the problem is that with the olla script you can not set retention by database
    but the value is defined by instance

  • Yes, you can, but you have to set up multiple backup jobs with different `@CleanupTime` and `@Databases` parameters. Just make sure they don't overlap / contradict each other, you'll be fine.

    Thomas Rushton
    blog: https://thelonedba.wordpress.com

  • the creation of the job it will be done that for the job of the backup full or even for the backup log I must do the same chause

  • If I understand correctly, I think you need to go to Ola's site and read the parameters, you don't need to use exactly the same clause, you can easily just specify a database, multiple databases, availability groups etc, you can also easily exclude databases from the backups.

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

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