Deleting files after restoring logs
DECLARE @sqlerrorcode int
exec master..sqlbackup N'-sql "RESTORE LOG [PEPPER_ic001Prd] FROM DISK = ''\\beet\d$\sqlbackups\atlanta\PEPPER_ic001Prd_*.sqb'' WITH STANDBY = ''D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\UNDO_PEPPER_ic001Prd.DAT'', ERASEFILES = 1h, FILEOPTIONS = 1, MOVETO = ''\\beet\d$\sqlbackups\Complete''"', @exitcode OUTPUT, @sqlerrorcode OUTPUT
IF (@exitcode <>0) OR (@sqlerrorcode <> 0)
RAISERROR ('SQL Backup job failed with exitcode: %d SQL error code: %d', 16, 1, @exitcode, @sqlerrorcode)
I believe that this SHOULD delete files from \\beet\d$\sqlbackups\Complete\ older than 1 hour, but it does not delelte them... Can somebody spot what I'm doing wrong?