Command line to add scheduled backup
sandrog
Posts: 3
Is it possible to use a command line to add scheduled backup?
After our registration process we will automatically create a database for the user and we would like to also automatically create a job for a daily backup for that database?
How to do that?
thanks
Sandro
After our registration process we will automatically create a database for the user and we would like to also automatically create a job for a daily backup for that database?
How to do that?
thanks
Sandro
Comments
For example, if I have databases A, B, C and D, running "BACKUP DATABASES EXCLUDE [A, B]..." will backup C and D. If I add a new database E and perform the same command, it will backup C, D and E automatically.
If you need more complicated behaviour, you would need to delve into the SQL Server Books Online, and in particular with job creation via Transact-SQL scripts... The following URL should give you a decent starting point: http://msdn2.microsoft.com/en-us/library/ms191450.aspx
Once you've got the basic script, you would need a way to manipulate it to add the new database name etc, but it can be automated.
Hope that helps,
Jason
Thanks a lot