This site is now 100% read-only, and retired.

XML logo

About the batch command
Posted by tong on Tue 29 Aug 2006 at 20:56
Tags: none.
[reposted from mlist]

Subject: About the batch command
Newsgroups: gmane.linux.debian.user
Date: Wed, 16 Aug 2006 12:19:50 +0200

Hi

The traditional Unix batch command is old and not sexy enough to generate
enough talk among the Linux users. However, I recently read a post that
hinted the powerfulness of the old utility. To make the long story short,
here are my questions, which are not explained clearly in 'man batch':

- I know that if I list my tasks one by one and sent to the batch command
at once, they'd be executed one by one. But what if I issue 10 different
batch commands one by one, which are all scheduled "now", would they still
be executed one by one? why?

- Which parameter is controlling the sequential execution? What if I want
to execute batch commands two at a time?

- Would batch jobs compete with CPU resources with my foreground tasks?

- Do I need to "nice" the tasks before submitting to batch? If not, what
is the default nice value for batch jobs?

thanks

 

Comments on this Entry

Re: About the batch command
Posted by Anonymous (213.164.xx.xx) on Fri 1 Sep 2006 at 11:00
> if I issue 10 different batch commands one by one, which are all
> scheduled "now", would they still be executed one by one? why?

Because batch only runs one command at a time.
Try it:

$ batch now
> sleep 60
> ^D
$ batch now
> sleep 61
> ^D
$ batch now
> sleep 62
> ^D

Now watch ps auxw

> What if I want to execute batch commands two at a time?

Put them in a script?

> Would batch jobs compete with CPU resources with my foreground tasks?

Of course. But they only start if the load average is <0.8
Look at nqs otherwise.

> Do I need to "nice" the tasks before submitting to batch?
> If not, what is the default nice value for batch jobs?

You don't have to, or need to, but if you think it would make the system run more smoothly, then do.
Mine run with a niceness of 4, and I haven't changed anything. Try it.

[ Parent ]