Comments
6 comments
-
Hi Jim,
Here is the gotcha: you also need to specify FILEOPTIONS=1 to delete the old files from the MOVETO location. -
Thank you for the quick reply, Brian.
But I did have the FILEOPTIONS=1 inside the code, the Log files in "Done" folder are not deleted:
DECLARE @exitcode int
DECLARE @sqlerrorcode int
exec master..sqlbackup N'-sql "RESTORE LOG [ECOM_REP] FROM DISK = ''E:\Microsoft SQL Server\MSSQL\BACKUP\LogShipping\ECOM_REP_Logs\LOG__ECOM_REP_*.sqb'' WITH NORECOVERY, ERASEFILES = 6h, FILEOPTIONS = 1, PASSWORD = ''trvel'', MOVETO = ''E:\Microsoft SQL Server\MSSQL\BACKUP\LogShipping\ECOM_REP_Logs\Done''"', @exitcode OUTPUT, @sqlerrorcode OUTPUT
IF (@exitcode <>0) OR (@sqlerrorcode <> 0)
BEGIN
RAISERROR ('SQL Backup job failed with exitcode: %d SQL error code: %d', 16, 1, @exitcode, @sqlerrorcode)
END -
I had this same problem. petey sent me version 4.2.0.318 which solved the problem.
It seemed to be caused by the primary DB name differing from the restore DB name... -
Thank you Jeff for the valuable info.
We have version 4.1.0.207 and this problem has caused me some headaches.
Can Brian or Petey send me version 4.2.0.318 ? We just bought 10 Server licenses 2 weeks ago. -
We are finalizing another fix with regards to license registration, and will inform you when we release the patch version which includes the fix for the ERASEFILES issue.
-
Thank you Peter/Brain. I am looking forward to receiving this patch version soon.
Jim
Add comment
Please sign in to leave a comment.
Thanks,
Jim