ERASEFILES causes backup error

Compresses, encrypts, secures and monitors SQL Server backups.

Moderators: JonathanWatts, Chris Auckland, eddie davis, Colin Millerchip, Brian Harris, james.billings, RBA, petey

ERASEFILES causes backup error

Postby beachldy » Thu Jun 28, 2012 2:16 pm

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
 
Posts: 10
Joined: Wed Sep 14, 2005 9:53 pm

Postby ChrisAVWood » Thu Jun 28, 2012 2:36 pm

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
English DBA living in CANADA
ChrisAVWood
 
Posts: 308
Joined: Tue Dec 18, 2007 6:18 pm
Location: Edmonton, Alberta, CANADA

Postby beachldy » Thu Jun 28, 2012 3:03 pm

THANK YOU! I thought I counted all the quotes....but missed one.
beachldy
 
Posts: 10
Joined: Wed Sep 14, 2005 9:53 pm


Return to SQL Backup 7

Who is online

Users browsing this forum: No registered users and 0 guests