Scripting
Misc scripting things
How execute a bash one-liner which echo’s
sleep
every 10 seconds until you stop it:
$ bash -c while true; do echo sleep; sleep 10;done && echo done
This proved useful when I needed to keep a container running
doing something while another container ran some
database migrations. The system1
running the containers would kill the migration container if the
other container finished, but the other container had the same
code and would otherwise deadlock the migration by trying to
perform the migration as well. Keeping it busy worked well to
avoid the exit 137
errors the system was giving me.