Problems with 2nd Copyto location

dklein9930dklein9930 Posts: 20
edited May 13, 2011 2:20AM in SQL Backup Previous Versions
My backup script is erroring out on the second copyto location. I am guessing it is permissions, but I want to be sure the scripts looks alright.

DECLARE @exitcode int
DECLARE @sqlerrorcode int
EXECUTE master..sqlbackup N'-SQL "BACKUP DATABASES [DBAdmin]
TO DISK = ''X:\WeeklyFullBackups\<AUTO>.sqb''
WITH
COMPRESSION = 3,
MAXTRANSFERSIZE = 524288,
ERASEFILES = 1,
KEYSIZE = 256,
PASSWORD = ''<ENCRYPTEDPASSWORD>kdleiwu28==</ENCRYPTEDPASSWORD>'',
MAILTO_ONERRORONLY= ''databaseerrors@company.com'',
COPYTO = ''\\Server1\SQLBackups\WeeklyFullBackups'',
COPYTO = ''\\Server2\SQLBackups\WeeklyFullBackups'',
ERASEFILES_REMOTE = 45,
FILEOPTIONS = 1"',
@exitcode OUT, @sqlerrorcode OUT


IF (@exitcode >= 500) OR (@sqlerrorcode <> 0)
BEGIN
RAISERROR ('SQL Backup failed with exit code: %d SQL error code: %d', 16, 1, @exitcode, @sqlerrorcode)
END

--Error is as follows: Warning 141: COPYTO error: Unable to copy X:\WeeklyFullBackups\FULL_(local)_DBAdmin_20110512_152435.sqb to \\Server2\SQLBackups\WeeklyFullBackups\FULL_(local)_DBAdmin_20110512_152435.sqb (The operation completed successfully).

Thanks in advance,
DK

Comments

Sign In or Register to comment.