Cronjob to check and restart service if dead

For check and restart services, if they are inactive/dead.
$ nano
STATUS=$(systemctl is-active snort)
# Most services will return something like "active" if they are in fact "active"
test "$STATUS" = "active" || systemctl restart snort
Change file permissions:
$chmod +x
Update your crontab:
$sudo crontab -e
# min   hour    day month   dow cmd
*/1 *   *   *   *   /path/to/
#every minute:
* * * * * /path/to/