COPYTO Error: Failed to create folder
jalfano
Posts: 24
Our company recently purchased and started using Red-Gate's SQLBackup (v5.x). One of the features we've adopted is the use of the COPYTO command to create remote server copies. This is working fine.
One of our off-site hosting facilities offers Red-Gate's SQLBackup as part of the hosting package. The version offered is v4.6.0.815. When using the COPYTO command I'm consistently getting the following error message for every database being backed up:
Where HostB is the server that contains the share called REMOTEBACKUP where we want to copy the files to. I checked that the SQL Server job scheduler is running as our SQL Service account. The SQL Service account has Change share permissions to the REMOTEBACKUP share and Modify NTFS permissions to the directory that the REMOTEBACKUP share is attached to. I also checked to make sure that those permissions are being applied to that directory and all subdirectories and files. I further tested by logging into the server as the service login and accessing the share: create directory / delete directory / ...etc...
The command I'm using in the job is as follows:
I am at a loss as to what is causing this error. Are there any known issues with using UNC paths when using the COPYTO command?
Thank you for your help,
John
One of our off-site hosting facilities offers Red-Gate's SQLBackup as part of the hosting package. The version offered is v4.6.0.815. When using the COPYTO command I'm consistently getting the following error message for every database being backed up:
Warning 145: COPYTO error: Failed to create folder: \\HostB\REMOTEBACKUP\Director
Warning 145: COPYTO error: Failed to create folder: \\HostB\REMOTEBACKUP\DirectorMaster
... etc ...
Where HostB is the server that contains the share called REMOTEBACKUP where we want to copy the files to. I checked that the SQL Server job scheduler is running as our SQL Service account. The SQL Service account has Change share permissions to the REMOTEBACKUP share and Modify NTFS permissions to the directory that the REMOTEBACKUP share is attached to. I also checked to make sure that those permissions are being applied to that directory and all subdirectories and files. I further tested by logging into the server as the service login and accessing the share: create directory / delete directory / ...etc...
The command I'm using in the job is as follows:
DECLARE @exitcode int DECLARE @sqlerrorcode int exec master..sqlbackup N'-SQL "BACKUP LOGS EXCLUDE [master, msdb, model, tempdb, ASPState] TO DISK = ''G:\MSSQL.1\MSSQL\Backup\<DATABASE>\<AUTO>'' WITH NAME = ''<AUTO>'', DESCRIPTION = ''<AUTO>'', ERASEFILES_ATSTART = 1, COMPRESSION = 1, THREADS = 1, FILEOPTIONS = 1, COPYTO = ''\\HostB\REMOTEBACKUP\<DATABASE>''"', @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 am at a loss as to what is causing this error. Are there any known issues with using UNC paths when using the COPYTO command?
Thank you for your help,
John
Comments