Back Up Specific Databases with the SQL Backup Master Command Line Interface (CLI)
SQL Backup Master is a powerful tool for managing your database backups. While the graphical user interface is intuitive for setting up and running backup jobs, the command-line interface (CLI) offers a streamlined way to automate and integrate your backup processes. This is especially useful when you need to back up a specific database within a larger, more complex backup job on demand.
In this post, we’ll show you how to use the SQL Backup Master CLI to target a specific database for backup and how to create a simple batch file to execute the process with a double-click.
Using the Command Line
The SQL Backup Master command-line interface allows you to execute backup jobs with specific parameters. The key to backing up a single database is to use the /jobName argument to specify the backup job, and the /databaseNames argument to target the specific database(s) you want to back up.
The basic syntax is as follows:
SqlBackupMaster.exe /jobName “Your Backup Job Name” /databaseNames “YourDatabaseName“
For this to work, you will need to open a command prompt, navigate to the SQL Backup Master installation directory, and then execute the command. Remember to replace “Your Backup Job Name” with the name of your backup job and “YourDatabaseName” with the name of the database you wish to back up.
Creating a Simple Batch File
For even greater convenience, you can create a batch (.bat) file to trigger the backup. This allows you to run the backup job without needing to open the command prompt and type the command each time.
Here’s how to create a simple batch file:
- Open a text editor like Notepad.
- Enter the command to execute the backup. You will need to provide the full path to the SqlBackupMaster.exe executable.
- Save the file with a .bat extension. For example, you could name it Backup_Sales_DB.bat.
- To run the backup, simply double-click the .bat file you just created. A command prompt window will appear and execute the backup job according to the parameters you specified.
Conclusion
By leveraging the SQL Backup Master command-line interface and simple batch files, you can create a flexible and powerful backup strategy. This approach is perfect for situations where you need to perform ad-hoc backups of specific databases without running an entire backup job, saving you time and resources.