A tool to serialize background task execution. Helps normalize resource usage, like CPU and network.
- You run the daemon. It creates an SQLite database in your home folder and is ready to do the job.
- You add background tasks with the
tsp
command, from cron scripts, event handlers and so on. Example:tsp ~/bin/fetch-mail
. - Tasks are executed one by one. Logs are kept for a month.
See current status (most recent tasks) with tsp
:
See single task details:
Create a file named /usr/lib/systemd/system/tsp.service
with the following contents (change the user name accordingly):
[Unit]
Description=Task spooler for ~hex
[Service]
Type=simple
ExecStart=/home/hex/.local/bin/tsp --run
Restart=always
RestartSec=5s
User=hex
Group=hex
After=syslog.target
[Install]
WantedBy=multi-user.target
This is my remake of ts, which is great! But it has some problems which I didn't like and wanted fixed.
- There was no explicit server. It was created on demand by first client run. Which didn't always work. I often found hundreds of hanging
tsp
processes locked on a queue or something. Not good. - Logs were saved as files in the
/tmp
folder, lots of them. Purged too often, not very easy to access.