Bash job queuing: Task Spooler

Tagged: Programming, Ubuntu Date: 9th, February 2009

Today I found nifty little tool for queuing bash jobs, Task Spooler.

Imagine you hava list of jobs that are dependant on each other.
First job converts video from one format to another, second job should trigger if first job was successful and do some status updating. This is exactly a thing Task Spooler will help you with.
It will prevent simultaneous video conversions by queuing them to run one after another.

Downside is that it listens to port 80 and I haven’t found a way to change that port. This is a “bad” thing because most people have apache listening on port 80 too, so to restart apache you will need to kill all Task Spooler processes or you will get an error that goes something like this:
Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
.

I will probably play with it some more and try to build out of the box methods for callbacks…

2 Responses to “Bash job queuing: Task Spooler”

  1. Lluís:

    I developed task spooler and I saw this entry. :)

    task spooler works with unix sockets, not tcp sockets. I don’t know how it does anything with TCP and port 80 in your setup.
    I use ts on linux servers which have apache running, and I’ve never had any problem like that.

    What system are you using? Please feel free to tell that in the taskspooler mailing list. :)
    Thanks.

  2. Raúl Salinas:

    I find Task Spooler very useful. I use it quite often. For example when reorganizing your disks, you often launch several mv/cp/rsync commands at a time. If they are simultaneously executed, the disks perform very badly. TS makes it very easy to execute exactly ONE (or several) processes at a time. Many programs existed for this, but this one runs the programs in the very exact context where they were launched.

    There are many possible usages. Do you want to launch several programs and then go to sleep? Run them with TS and finally execute “ts sudo halt”. Voilà!

    What do you say about the port 80? TS does not open any TCP port, it has (by now) no HTTP server.

    Enjoy this cool tool!
    Raúl

Leave a Reply