Supervisor & Crontabs
Sraban Pahadasingh April 14, 2020 05:49 PMSupervisor (Running Program as a process)
When commad stops after closing the shell terminal, Supervisor takes care to run the command in background as process, Whenever required the process can be killed on shell.
Steps to run the angular development server in background
- sudo apt-get install supervisor
- vim /etc/supervisor/conf.d/ngServe.conf
- supervisorctl
- vim /var/log/ngServe.out.log
- tail -f /var/log/ngServe.out.log
- ps ax | grep PID(4098)
inside the file "ngServe.conf"
- [program:ngServe]
- command=cd /var/www/html/ng && ng serve --port=8088
- autostart=true
- autorestart=true
- stderr_logfil=/var/log/ngServe.out.log
- stdout_logfile=/var/log/ngServe.out.log
Crontab examples
- crontab -e
- Examples
- 0 5 1 tar -zcf /var/backups/home.tgz /home/
- 0 5 1 php /var/www/html/run.php
- 0 5 1 php php artisan comission:monthly