🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cis.winnt.general
Article #188

Re: Sample Scripts (Re: Sheduling the startin and stopping of Services)

#188
From: Scott
Date: Thu, 07 May 1998 00:00
122 lines
4009 bytes
Use the Schedule service and a batch file.
The batch file will contain the commands to stop the services and the
ntbackup command with the appropriate switches.  Also, you can put the
commands to start the services back up after the ntbackup command.

Hope this helps

Scott Smith
scREMOVEsmith@surfsouth.com


Thomas Beagle wrote in message ...
>Brett Graham wrote
>>I want to do a back-up of my NT
>>server but want to back every file,
>>including the open ones.  The only
>>way to get around the open files problem
>>seems to be to shut down several
>>services.  I don't want to have to do this
>>manually every time, so does anyone
>>know of a way to shekel the starting and
>>stopping of services?  I would
>>appreciate any help.
>
>
>The answers you've got are largely correct, here's some sample scripts
>which solve a few of the common problems.
>
>Firstly, always create a batch file to schedule the job. This means
>that if you wnt to change the schedule, you just delete the job,
>change the script and rerun it. No trying to remember how you
>scheduled it last time or what the syntax for the command is.
>
>Secondly, I've split the script which stops the services and does the
>backup from the one which restarts the services. Otherwise you'll have
>a bad tape one day, the backup will ask you a question and you'll
>arrive at work to find out that your services aren't going and your
>users are not happy. Splitting them means that the services start
>again at a definite time whether the backup is finished or not.
>
>
>================
>atbackup.bat
>---------------------
>@echo off
>rem Schedules the Regular Backup
>rem This only needs to be run once to schedule the backup.
>rem Thomas Beagle 30/1/97
>
>rem Schedule the Backup
>at \\wgtn1 04:30 /interactive /every:M,T,W,Th,F,S
>c:\scripts\backreg.bat
>
>echo Show Scheduled Jobs
>at
>
>===========================
>backreg.bat
>------------------------------
>@echo off
>
>rem Closes down services and then runs the regular backup.
>
>rem Scheduled by atbackup.bat
>
>rem Services are restarted by srvres.bat
>rem This ensures that services are restarted even if the
>rem backup job has problems
>
>rem Thomas Beagle 30/1/97
>
>rem Stop services
>net stop sms_executive
>net stop sqlexecutive
>net stop mssqlserver
>net stop "lotus domino server"
>net stop dhcpserver
>net stop wins
>
>rem Start backup
>ntbackup backup C:\ d:\ E:\ /r /b /hc:on /e /t normal /l
>"c:\logs\backup.log"
>
>=================
>atsrvres.bat
>-----------------------------
>@echo off
>rem Schedules the service restart task
>rem Thomas Beagle 30/1/97
>
>rem Schedule Job
>at \\wgtn1 06:00 /interactive /every:M,T,W,Th,F,S
>c:\scripts\srvres.bat
>
>Echo Scheduled Jobs
>at
>
>=============
>srvres.bat
>-------------------------
>@echo off
>
>rem Restarts services stopped by backreg.bat
>rem Scheduled by atsrvres.bat
>
>rem Thomas Beagle 30/1/97
>
>net start dhcpserver
>net start wins
>net start sqlexecutive
>net start mssqlserver
>net start sms_executive
>net start "lotus domino server"
>
>
>--
>Thomas Beagle, MCSE
>thomasb@sapphire.co.nz
>Sapphire Technology Ltd
>
>
Technical Details
Message-ID: <3552f506.0@news.surfsouth.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6ip6kt$e2c$1@soap.news.pipex.net> <OoFM2OWe9GA.229@uppssnewspub05.moswest.msn.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb96d,4c55617b1810086
X-Google-Attributes: gidfb96d,public
X-Google-Thread: 104ed6,4c55617b1810086
X-Google-Attributes: gid104ed6,public
X-Google-Thread: f782f,4c55617b1810086
X-Google-Attributes: gidf782f,public
From: "Scott" <scsmith@surfsouth.com>
Subject: Re: Sample Scripts (Re: Sheduling the startin and stopping of Services)
Date: 1998/05/07
Message-ID: <3552f506.0@news.surfsouth.com>
X-Deja-AN: 351551636
References: <6ip6kt$e2c$1@soap.news.pipex.net> <OoFM2OWe9GA.229@uppssnewspub05.moswest.msn.net>
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Organization: Surf South, Inc.
Newsgroups: cis.winnt.general,comp.os.ms-windows.nt.admin.misc,microsoft.public.windowsnt.misc