Supervisor & Crontabs

Sraban Pahadasingh    April 14, 2020 05:49 PM

Supervisor (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

  1. sudo apt-get install supervisor
  2. vim /etc/supervisor/conf.d/ngServe.conf
  3. supervisorctl
  4. vim /var/log/ngServe.out.log
  5. tail -f /var/log/ngServe.out.log
  6. ps ax | grep PID(4098)

inside the file "ngServe.conf"

  1. [program:ngServe]
  2. command=cd /var/www/html/ng && ng serve --port=8088
  3. autostart=true
  4. autorestart=true
  5. stderr_logfil=/var/log/ngServe.out.log
  6. stdout_logfile=/var/log/ngServe.out.log

Crontab examples

  1. crontab -e
  2. 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





Comments powered by Disqus