>NULL: Using forfiles to remove older backups (last resort) 14 days and older.

Monday, 22 July 2019

Using forfiles to remove older backups (last resort) 14 days and older.

Add the following as a second step in the SQL job, possible catches are you need to set the first step behavior as run second step on success. Modify Advanced Page for success action. Second step Type: Operating System (CmdExec).

F:
CD F:\SQLBackups
forfiles /m *.bak /c "cmd /c Del @file" /d -14


No comments:

Post a Comment