Scheduled tasks in sequence (nested)

G

Guest

I would like to use "scheduled tasks" in XP to handle maintenaince tasks such
as cleaning, scanning, backup, defragmentation etc. So my computer will start
at midnight say, do the specified tasks one by one and then shutdown.

I do not want to have these tasks run i parallel, since they potential
conflict which each other.

I can get these tasks running one at a time, but I cant find out to nest
them together into a sequence.

This must be a common practise so I am surpsied I havent been able to find a
solution anywhere.

TIA.

Jqrn
 
P

Pegasus

Jørn Lodahl said:
I would like to use "scheduled tasks" in XP to handle maintenaince tasks
such
as cleaning, scanning, backup, defragmentation etc. So my computer will
start
at midnight say, do the specified tasks one by one and then shutdown.

I do not want to have these tasks run i parallel, since they potential
conflict which each other.

I can get these tasks running one at a time, but I cant find out to nest
them together into a sequence.

This must be a common practise so I am surpsied I havent been able to find
a
solution anywhere.

TIA.

Jqrn

Simple: Use the Task Scheduler to invoke a batch file. The
batch file itself should contain all the commands you wish to
run, arranged in the correct sequence.
 
C

C.Joseph Drayton

Jørn Lodahl said:
I would like to use "scheduled tasks" in XP to handle maintenaince tasks such
as cleaning, scanning, backup, defragmentation etc. So my computer willstart
at midnight say, do the specified tasks one by one and then shutdown.

I do not want to have these tasks run i parallel, since they potential
conflict which each other.

I can get these tasks running one at a time, but I cant find out to nest
them together into a sequence.

This must be a common practise so I am surpsied I havent been able to find a
solution anywhere.

TIA.

Jqrn

Hi Jqrn,

I have set up something like that for clients and what I
ended up doing was just setting the task for different
times. because their laptops are pretty stable, I was a able
to get approximate running times for each operation. I then
just added 60 minutes to each running time and schedule the
operations to be done over an 8 hour period of time once a week.

For clients where that is not possible, I wrote a program
that runs each procedure then does not go to the next until
each operations window closes signifying that the procedure
is complete before going to the next.

Ciao . . . C.Joseph

"A promise is nothing more than an attempt,
to respond to an unreasonable request."
 
G

Guest

thanks for your reply. Actually I have tried a bacth file solution and feared
that would be the answer.

It is not my preferred solution since I then control something in the Task
Scheduler and something in batch files.

Moreover this solution has some drawbacks:
1. Task #2 starts right after task #1 has startet, it should wait until task
#1 has completed.
2. There might be some limitations when programs are started from command
line (I have not chekked all options for all programs).
3. It appears that the tasks are running slow, e.g. AVG anti rootkit hasn't
finished after eight hours)
These might be handled with though, if a good old .bat file is the only way.

Regards

Jqrn
 
P

Pegasus

See below.

Jørn Lodahl said:
thanks for your reply. Actually I have tried a bacth file solution and
feared
that would be the answer.

It is not my preferred solution since I then control something in the Task
Scheduler and something in batch files.

Since your tasks are interdependent, you must control them from
one central point. This is your batch file. If you control them from
the Task Scheduler then you end up with messy schemes such
as estimated time delays etc. which have a tendency to fail.
Moreover this solution has some drawbacks:
1. Task #2 starts right after task #1 has startet, it should wait until
task
#1 has completed.

Most tasks will pause the batch file until they have finished but some
won't. This is a property of the task itself, not of the batch file. To
get around it you can do this:
@echo off
c:\tools\task1
:Label1
ping localhost -n 30 > nul
tasklist | find /i "task1" && goto Label1

c:\tools\task2
:Label2
ping localhost -n 30 > nul
tasklist | find /i "task2" && goto Label2
etc.
2. There might be some limitations when programs are started from command
line (I have not chekked all options for all programs).

If you can start a program from the Task Scheduler
then you can start it from a Command Prompt or from
a batch file. No exceptions!
3. It appears that the tasks are running slow, e.g. AVG anti rootkit
hasn't
finished after eight hours)
These might be handled with though, if a good old .bat file is the only
way.

This is precisely the situation where staggering your commands
with estimated delays would fail. Your batch file can handle this
situation with ease.
 
G

Guest

Pegasus, thanks for your persistence!

Nice trick to loop until the "tasklist find... condition" is met. I will
check in which cases I will need it, I guess performance is better if I omit
it when I dont need it. I have seen anotherway to make delays instead of the
ping one, i.e.
CHOICE /N /CY /TY,5
but both will work, its only a matter of performance.

A major problem though is that tasks run for "ever". I have now the first
task to be "emptemp2" which has now run for 12 hours on a PC which otherwise
has not been in use. So apparently I need to adjust something, any clues
anybody?

Regards

Jqrn
 
P

Pegasus

We can't tell you why "emptemp2" runs forever. Since it is
not a Windows application, you have to ask the supplier why
it won't stop.

You need to be careful when using "choice" for a time delay.
This is a Win98 16-bit application, not a WinXP tool, and
there is a risk that it absorbs far more CPU time than ping.exe.
Check it out with the Task Manager!
 
G

Guest

I have now iterated over this issue and it appears that my problems are due
to programs which (I) cannot execute correctly from command line.

This also means that the batch solutions works fine for other programs, in
some cases by using the "delaying loop trick" suggested above by Pegasus.

Thanks!

Regards

Jqrn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top