Simple solution for automated tasks execution in Linux.
Automated scripts execution just after your system is ready to be used can be very handy, especially if you want provide more or less stable environment to your tasks requiring running after boot time. ABE helps you here.
Copy content of this package (excluding top files, i.e. README.md and any other
files available at this level) to root directory /
. Add following line to
/etc/inittab
:
abe:23:once:/sbin/getty -inl /usr/local/sbin/abe 38400 tty8
Just put your scripts in /tasks/pending
directory and make them executable.
Next time you boot up your system, they will be executed in a consecutive
manner (alphabetically ordered). Depending on a returned code, each script will
be moved to appropriate subdirectory of /tasks
- success
or failure
.
During execution you can see the results in eighth console (use Ctrl+Alt+F8 to
show it).
You can apply additional requirements to your scripts by preceding program
loader defined in shebang with path to abe-run
and condition, which can be:
- required-kernel-version, tested against
uname -r
, run-as-first-task
, enforcing reboot if it is not the first executed script.
If required-kernel-version is other than the current running one, ABE looks
for grub entry which title ends with required-kernel-version text and reboots
into it. If such entry does not exist, script will be moved to /tasks/skipped
directory.
#!/usr/local/bin/abe-run 2.6.32 /bin/sh
Proper handling of kernel version dependency in scripts, i.e. automatically
rebooting into needed kernel, requires grub
and strict naming convention
of grub menu entries - they should end with their kernel release text (the one,
which is returned by uname -r
if you boot into them).
USE AT YOUR OWN RISK! NO WARRANTY!
If you find any bug, then please create new issue in GitHub and describe it there.
Przemysław Pawełczyk <przemoc@gmail.com>