<commit_before>services-checker
================

Bash Script to check if services are running and restart if not. Sends email to you.


INSTALL:

1. put into your scripts folder
2. set your email address
3. set the services you want to keep an eye on (by default it has mysql and apache2..you can add or take away whatever you need)
3. save your changes
4. create a cronjob as root (sudo crontab -e)  and add something like this, which runs every minute (adjust to your needs):

#check on services
*/1 *  * * * /your/path/to/scripts/services

The script will look at the exit code after checking the status of each service. If the service is stopped (exit code 3), it tries to restart the service. If the service status then gives an exit code of 0, it sends you an email saying the service stopped, but was restarted.

If the service does not start for some reason, it sends you an email telling you it was not started.


#################################################
WISH LIST:

- rather than sending new emails for a service that won't restart, it would be cool if it could try maybe 3 times and then give up. Not sure how to do that yet.






<commit_msg>updated ReadMe for better format<commit_after>services-checker
================

Bash Script to check if services are running and restart if not. Sends email to you.


#INSTALL:

1. put into your scripts folder
2. set your email address
3. set the services you want to keep an eye on (by default it has mysql and apache2..you can add or take away whatever you need)
3. save your changes
4. create a cronjob as root (sudo crontab -e)  and add something like this, which runs every minute (adjust to your needs):



```
#check on services
*/1 *  * * * /your/path/to/scripts/services

```

The script will look at the exit code after checking the status of each service. If the service is stopped (exit code 3), it tries to restart the service. If the service status then gives an exit code of 0, it sends you an email saying the service stopped, but was restarted.

If the service does not start for some reason, it sends you an email telling you it was not started.


#################################################
#WISH LIST:

- rather than sending new emails for a service that won't restart, it would be cool if it could try maybe 3 times and then give up. Not sure how to do that yet.







{'fraction_non_alphanumeric': 0.10160880609652836, 'fraction_numerical': 0.00846740050804403, 'mean_word_length': 3.783400809716599, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3763264', 'n_tokens_mistral': 633, 'n_tokens_neox': 596, 'n_words': 390}