Gearman is a awesome job queue service that helps you scale your system. In smaller context, it can help us to run a background woker for minor tasks like backup data, cleaning system.
$ sudo apt install gearman-job-server gearman-tools
Create a worker bash script
-w means run as worker mode ,
-f test means function name will be
$ chmod +x worker.sh
$ gearman -w -f test xargs ./worker.sh
$ gearman -f test "hello" "hogehoge"
Sending background job
$ gearman -b -f test "hello" "hogehoge"