linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emiliano Castagnari <ecastag@fi.uba.ar>
To: urgrue <urgrue@tumsan.fi>
Cc: "Adrian C." <drupix@gmail.com>, linux-admin@vger.kernel.org
Subject: Re: a command "spool", ie queueing commands?
Date: Wed, 3 Aug 2005 21:57:10 -0300	[thread overview]
Message-ID: <20050804005710.GA16052@open-core.com.ar> (raw)
In-Reply-To: <1122969644l.1939l.0l@hyttynen>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

El  [ Tue 02, Aug 05 - 08:00 ] , urgrue expreso:
> >Could you please give us a real-life example?
> 
> Well, for example imagine you're doing some maintenance on a server.  
> You want to move some big files, run updatedb by hand, run a script  
> that parses a bunch of files, and finally merge some video files.
> 
> Because these are very disk-heavy operations, it's much better and  
> quicker if they are not run at once, but are run sequentially instead.
> 
> So normally you'd probably use "at" to run one now, another in an hour,  
> etc. But this is dumb because you have to simply try and guess if the  
> job is done or not. You could also run them in sequence by putting them  
> all in the same "at" job, but its not possible to add or remove  
> commands from an "at" job once its created. Also, "at" is "user-aware",  
> ie if two users set up two at jobs they will happily run at the same  
> time. What I propose would add all commands to the same queue, even if  
> a different user is the one launching the command (but of course the  
> commands should be run AS the user who started it).


Hi !!

You could try something like:

 $ command1 && command2 && command3

&& is a meta character. If the return code of the last command executed 
evaluates to true, it will execute the next command.

It is a bash an sh meta-character, I don't know if it'll work on other shells.

The only drawback I can see, is that if any of this commands finish with an
error, that will be the end of your queue :(

Another way, is to simply develop it ... it doesn't seem like a very hard one
to code :)

Cheers !!
- -- 
# Emiliano Castagnari
[ -========================================================================- ]
          ('>   # Debian Sarge - GNU/Linux -  lambda 2.6.10-l01 #
    Gnu / (/)   # JID: torian@lug.fi.uba.ar
          '--   - } [ Libera tu mente - Libera tu Codigo ] { - 
[ -========================================================================- ]
[ GPGKey: http://gpg.lug.fi.uba.ar:11371/pks/lookup?op=get&search=0x0B8AF76F ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFC8WfmbsFzaguK928RAuTOAKC3YJiRnOc1jU4aZC5VFyz0N38PgACgpxWT
Ac1nvXdKaiwMSAWhzSyWFmc=
=h9Lm
-----END PGP SIGNATURE-----

  parent reply	other threads:[~2005-08-04  0:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1122963263l.32575l.0l@hyttynen>
     [not found] ` <60a7468905080200315678d209@mail.gmail.com>
     [not found]   ` <1122969644l.1939l.0l@hyttynen>
2005-08-02 13:14     ` a command "spool", ie queueing commands? asterr
2005-08-04  0:57     ` Emiliano Castagnari [this message]
2005-08-04  7:26       ` urgrue
2005-08-04 11:16         ` Glynn Clements
2005-08-04 16:27           ` command spooling tangent Jim Roy
2005-08-09  0:54 ` a command "spool", ie queueing commands? Mike Castle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050804005710.GA16052@open-core.com.ar \
    --to=ecastag@fi.uba.ar \
    --cc=drupix@gmail.com \
    --cc=linux-admin@vger.kernel.org \
    --cc=urgrue@tumsan.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).