Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating backups

Status
Not open for further replies.

maff

MIS
Jul 5, 2000
31
GB
Being an Arts Institute we have fairly large servers running
around 320Gigs of data. As DAT backup is obviously too slow
and capacity too small, until we get the budget to buy a wacking DLT store we've used a standalone NT server with 4
80GB drives.
The idea is to use a simple script fired off by the AT command every night to copy the files from the servers to the backup server across the network.

I have written a script using the XCopy command with the source and destination UNCs and writing to a log on the backup server.

If I run this script manually it works fine, but if I schedule it to run with the AT command it doesn't. I've tried running it with the /INTERACTIVE switch, but it just flashes up with ACCESS DENIED when trying to copy the files.
Does the scheduled script need system privalidges to copy the files?

Can anyone help please!


Matt ffolliott-Powell
maff_ffolliottpowell@yahoo.com
King of the wild frontier
 
The fact that your script works fine manually goes on to show that your script is OK. As I see it the problem is with the schedule service. By default this service is set to manual startup option. You have to make it to start automatically using the services icon in control panel i.e. it will start with the server startup and then you will be able to use AT command using the schedule service. Check it out, may be that's the reason why your script isn't working at the schduled time.
 
Yes, the Scheduler service is set to start automatically and is running, I've tested it by setting it to run 2 minutes from scheduling it and it runs, and terminates, but nothing seems to happen (apart from saying access denied when trying to copy files).


Matt ffolliott-Powell
maff_ffolliottpowell@yahoo.com
King of the wild frontier
 
Have looked at another server with NT4 and SP6a (identical to the afore mentioned server) and the scheduler service is called 'SCHEDULER' under control panels, services whilst on the original server its called 'TASK SCHEDULER'.

The 'SCHEDULER' service allows me to assign a account to it, but the 'TASK SCHEDULER' only works with a system account. WHY IS THIS!?!

Needless to say I've now got it working with the 'SCHEDULER' service...

Does anyone know why there are two versions of the service?

Matt ffolliott-Powell
maff_ffolliottpowell@yahoo.com
King of the wild frontier
 
I Think you will find that IE5 updates the scheduler
 
OK, Scheduler and Task Schduler services have nothing to do with SPs, one thing. Second, if you check the IE on the server with Scheduler it would be IE 4.0 or older and if you check the browser version on the server with Task Scheduler it would show IE 5.0 or newer. Task Scheduler uses wizards to automate tasks and is easier to use than the combination of Scheduler service and the AT command. That's the reason Task Scheduler needs only system account to perform tasks.

Coming back to your problem, the second issue to look into is: who can submit the AT command? By default, only administrators can submit AT command and you have to edit the registry to allow server operators to do the same. As far as I know there’s no other way to allow anyone else to submit an AT command. As I picture it, when you try your AT command, you are logged on as anyone from the administrators group and the command works. When you schedule the command to trigger at night the current user doesn’t seem to have administrative privileges that’s why you get the ‘Access Denied’ message. This is just one aspect. On the other end, you should check the write access of the current user on the network share of the backup server. Check to see if there are any conflicting permissions.

Hope it helps.
Mubashir
 
I think that, given the scenario you described above, you should almost certainly check the account that you are using to run the Scheduler service. A system account would not work in this case, since you are copying from one server to another.

You said that when you schedule the script to run interactively, it fires off ok but comes up right away with an Access Denied, right? This script is running with the credentials under which the Schedule service is running.

So go into Control Panel/Services/Schedule/Startup, and switch it to run as a domain account. Try switching it to Yourdomain\Administrator, stop and restart the service, and try rescheduling the batch job. I bet it will work, as long as the Administrator account has permissions to the directories involved. (You might want to set up a special account for this instead of Administrator.)

1 more comment: instead of Xcopy, I would seriously think about using the Robocopy command (from Resource Kit Supplement 4.) Robocopy is a more robust copy command which was made for this sort of thing (backups etc.)

Actually I have an additional comment pertaining to this thread: the reason that the Startup option for Task Scheduler is limited to the system account, is because with Task Scheduler you supply the credentials for each job that runs. You can have 1 task which runs using an Administrator account, another one using a backup operator account, etc. etc.



 
I am trying to schedule a task with the AT cmd and am unsuccessful. I have tried to set up simple COPY commands and they fail to execute at the appointed AT task ID time.

I keep getting "Error" next to the command after it's time passes in the the AT list of commands. THis happens whether I log on as my ID on my NT workstation (for which I have administrator rights) or whether I log on as system administrator. I have NT 4.0 sp6.

I opened start/control panel/ services and found I have Task Scheduler running with Automatic Startup.When I click Startup the Service windows shows the Automatic radio button selected and the box Allow Service to Interact with desktop checked. The following are grayed out: This Account, Password, Confirm Passowrd.If I click on another service - Spooler - for instance, the This Account, Password, and Confirm Password are not grayed out.

The previous reply says

<So go into Control Panel/Services/Schedule/Startup, and switch it to run as a domain account. Try switching it to Yourdomain\Administrator, stop and restart the service, and try rescheduling the batch job. >

I do not understand how this can be done.

Is there something in the system configuration at the domain level that I have to ask my LANMAN to alter so we can set up some AT commands using Task Scheduler?
 
First of all you should ensure that your batch file runs fine manually.

Prior to Task Scheduler, tasks needed to be configured using the AT command and the Schedule service. Internet Explorer ver 5 upgrades the Windows NT 4.0 Schedule service (Atsvc.exe) to the Task Scheduler (Mstask.exe).

You either have upgraded to IE 4 with the task scheduler option or you've upgraded to IE 5 which replaces the schedule service altogether. That's the reason you can't the account, pwd etc. is grayed out.

Now that you want to schedule a task for the first time, you should do this:

My Computer > Scheduled Tasks > Add Schduled Task

to start the wizard. Just follow the instructions. Somewhere it'll ask for username and password.

You can schedule anything with this and you don't have to use AT anymore.

Hope this helps. Mubashir
muhammad.mubashir@sbp.org.pk

Imagination is more important than knowledge. - Newton
 
Thank you - your info is a great help - but Is there some way to set up a script or get to the scripting that this task schedule tool creates - so I can set this up as a scripted event - subject to the same ability to edit the script that other scripting lends itself to?

Ray
 
Yes, i think it's possible.

Like I said earlier, Task Scheduler replaces the Schedule service. The Schedule service no longer shows up in the Services utility in Control Panel. I assume you're using IE 5 or higher with Task Scheduler. You must know that Task Scheduler can't be used from command prompt. But since you require command line functionality for your scripts you'll have to revert to Atsvc.exe or Schedule service.

IMO, you have a few options here:

1. Depending upon version of Task Scheduler, you can remove it from Control Panel > Add/Remove

2. Uninstall IE 5 or whatever, if you have the option

3. I read somewhere that Mstask.exe can be manually replaced with Atsvc.exe by editing the registry. Meaning you can have the Schduler service back in place to be used with AT command in your scripts. Since I haven't tried this, I can't say much.

If you can throw in some more info regarding your IE version and the services, may be we can workout a logical solution. Mubashir
muhammad.mubashir@sbp.org.pk

Imagination is more important than knowledge. - Newton
 
Thanks for the info - for my needs I'll just live with the Task Scheduler GUI and let it drop there.

Ray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top