ERASEFILES causes backup error
beachldy
Posts: 17
This is the backup script and it fails since adding the ERASEFILES items.
EXEC master..sqlbackup N'-SQL "BACKUP DATABASES [MYDB] TO DISK = ''F:\MSSQL\BACKUP\<AUTO>''
WITH NAME = ''<AUTO>'', DESCRIPTION = ''<AUTO>'', COMPRESSION = 3 , ERASEFILES = 3, FILEOPTIONS = 1, ERASEFILES_REMOTE = 3",@exitcode OUTPUT, @sqlerrorcode OUTPUT
I've tried omitting the ERASEFILES_REMOTE, omitting the ERASEFILES, omitting the FILEOPTIONS, and none of these work.
EXEC master..sqlbackup N'-SQL "BACKUP DATABASES [MYDB] TO DISK = ''F:\MSSQL\BACKUP\<AUTO>''
WITH NAME = ''<AUTO>'', DESCRIPTION = ''<AUTO>'', COMPRESSION = 3 , ERASEFILES = 3, FILEOPTIONS = 1, ERASEFILES_REMOTE = 3",@exitcode OUTPUT, @sqlerrorcode OUTPUT
I've tried omitting the ERASEFILES_REMOTE, omitting the ERASEFILES, omitting the FILEOPTIONS, and none of these work.
Comments
It should read ERASEFILES_REMOTE = 3'"
There was the ' before -SQL "BACKUP that you have no ending ' for.
Chris