This is an example about how to turn your .py
files into a process with a PID number UNIX. This is suitable when you would like to run a task for an indefinite period of time. This also allows you to reserve you shell section, and this can be particulary good when using containers.
All of that is possible by running what is called a daemon process. For more information google it
Install requirements.txt
using pip install -r requirements.txt
Run the following commands in shell:
python app_daemon.py --t 1 --path /home/
This script is merely an example and it just creates ordered dumb files in a given path each t seconds for as along as the process run.
This is an extension of this example, providing an integration with argparse module.
Among all process ruuning grep the one by its .py
name and kill it as,
ps ax | grep app_daemon
GET THE PID NUMBER and,
kill #######