How can we help you today? How can we help you today?

ERASEFILES causes backup error

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.
beachldy
0

Comments

2 comments

  • ChrisAVWood
    You are missing a ' at the end.

    It should read ERASEFILES_REMOTE = 3'"

    There was the ' before -SQL "BACKUP that you have no ending ' for.

    Chris
    ChrisAVWood
    0
  • beachldy
    THANK YOU! I thought I counted all the quotes....but missed one.
    beachldy
    0

Add comment

Please sign in to leave a comment.