I really do not understand the batch file that you provided.
I realize that you are determining the day of the week and then doing a
backup somehow using the osql line. I do not understand that line at all,
could you explain it please.
--
Neil
- Show quoted text -
osql is a command line SQL processor. It will submit SQL to a
specified database on a specified server. I use it as I can put it in
a batch file and then use schedular to make it run every night. Bring
up a command prompt and type osql /? for more help but...
-E forms a trusted connection from the caller to the server and the -S
specifies the server we are hitting. Unless you have installed things
differently your BCM server is .\microsoftsmlbiz (note the .\ bit).
So, we have asked the sql parser to make a secure connection to the
small business server which is running your BCM database. The -Q is
the Query we want to send to the server. So, lets examine the SQL we
are sending to the server
Now, the server can support several databases so we need to tell it
the name of the BCM database we are using. This is the name of the
database you created from your initial BCM setup. We are wanting to do
a backup so our SQL query is "backup database X" I say X 'cause I dont
know what you called your BCM DB. We also need to tell it where to
send the backup to, as part of the SQL command we say "to disk=A
Filename" where A Filename is the fully qualified path to your backup
file (it is THIS file that will be backed up by your existing backup
software) Now, I happen to store my backups in c:\this\that\theother\
(I dont of course, but there you go). The stuff about day of the week
is to automatically generate a file called Monday.bak then one called
Tuesday.bak then one called Wednesday.bak etc. Now when 7 days have
gone by I start to overwrite the files and the WITH INIT bit ensures
that a clean copy is generated.
In essence, go into a command prompt and type...
osql -E -S .\microsoftsmlbiz -Q "backup database XXX to disk= 'C:\Blah
\Blah\Test.bak' WITH INIT"
be sure to use the single quotes around the file name and the double
quotes around the -Q parameter. Also, replace the XXX with the name of
your BCM database. This SHOULD create a file called Test.bak in c:\blah
\blah (you may well want to replace the blah blah as well) which can
be restored to the BCM by a SQL restore command (more later)
Hope that helps, if not feel free to ask for more and I'll email you
direct
Stuart