Jump to content

Recommended Posts

Posted

i need a script to stop SQL services so the sims backup (scheduled nt backup) can start, then a reboot / shutdown (in a set amount of time / when the back ups done) so the services will start again.

 

Anyone got a script like this? if not what do you use to backup sims and stop SQL??

 

psuedo code:

Stop SQL services
if SQL Services are stopped
    Start backup
end if
if backup complete / if time >= 10 mins
     start sql services
end if
Shutdown

if script does not work
    Place gun to head
    Pull trigger
end life 

Thanks in advance :D

Posted

All sorted!!

 

@Echo Off

Echo Starting to Backup the SIMS Database

C:\Program Files\Microsoft SQL Server\MSSQL$SIMS\Binn\dbattach

/backup /auto /server= /database=SIMS

/user=BACKUP /password=backup

Echo Finished Backing up the SIMS Database

Pause

 

 

AT 22:00 /Interactive /Every:M,T,W,Th,F C:\Backup\SIMSBackUp.Bat

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...