0

My objective is to backup a remote SQL Server database using SQL Server command line tools for Mac (or Linux). After installing the sqlcmd utility, I am able to connect to the database but am not sure how to handle the TO DISK command, whose default is to assume a Windows operating system.

sqlcmd -S myserver.com -U AIS -Q "BACKUP DATABASE mydb TO DISK = N'/mybackups/mydb.bak' WITH NOFORMAT, NOINIT, NAME = 'mydb', SKIP, NOREWIND, NOUNLOAD, STATS = 10"

This command returns the error:

Cannot open backup device 'D:\BACKUP\mybackups\mydb.bak'. Operating system error 3 (The system cannot find the path specified).

I have tried changing access permissions of the folder mybackups using chmod 777 mybackups but the same error is still thrown. Any idea about how to solve this?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
iskandarblue
  • 7,208
  • 15
  • 60
  • 130

0 Answers0