<commit_before># clashcallerbot.sh
#
# Script to check for and start clashcallerbot scripts as background processes.
#
# Notes:
# * Remember to set executable mode with `chmod +x ./clashcallerbot.sh`
# * Script assumes files are in the `clashcallerbotreddit` directory and is run as crontab in amazon linux setup
#   * How often to run as a crontab depends on how long you want the bot to be down/broken
#   * If you have access to root, check the Docs for info on setting up systemd instead
# * Logfile can be removed if not necessary (remove variable and `>> $logfile`)
# * `python` can be replaced with relevant python version
# * The function in `kill` returns all script PIDs, so it must be restarted.
#   * If you have access to `pidof`, you can avoid killing all script instances
#

source ./env/bin/activate  # set virtual environment

# Make logs directory
if [ ! -d logs ]; then
    echo 'Creating logs directory...'
    mkdir ./logs
    echo '*****'
fi

logfile="./logs/clashcallerbotlog.txt"

case "$(ps -ef | grep '[p]ython3 -m clashcallerbotreddit.reply' | wc -l)" in

0) echo "Starting reply.py: $(date)" >> $logfile
   nohup python3 -m clashcallerbotreddit.reply > /dev/null 2>&1 &<commit_msg>Update clashcallerbot.sh specified python3 in notes and fixed inline code blocks<commit_after># clashcallerbot.sh
#
# Script to check for and start clashcallerbot scripts as background processes.
#
# Notes:
# * Remember to set executable mode with ``chmod +x ./clashcallerbot.sh``
# * Script assumes files are in the `clashcallerbotreddit` directory and is run as crontab in amazon linux setup
#   * How often to run as a crontab depends on how long you want the bot to be down/broken
#   * If you have access to root, check the Docs for info on setting up systemd instead
# * Logfile can be removed if not necessary (remove variable and ``>> $logfile``)
# * ``python3`` can be replaced with relevant python version
# * The function in ``kill`` returns all script PIDs, so it must be restarted.
#   * If you have access to ``pidof``, you can avoid killing all script instances
#

source ./env/bin/activate  # set virtual environment

# Make logs directory
if [ ! -d logs ]; then
    echo 'Creating logs directory...'
    mkdir ./logs
    echo '*****'
fi

logfile="./logs/clashcallerbotlog.txt"

case "$(ps -ef | grep '[p]ython3 -m clashcallerbotreddit.reply' | wc -l)" in

0) echo "Starting reply.py: $(date)" >> $logfile
   nohup python3 -m clashcallerbotreddit.reply > /dev/null 2>&1 &
{'fraction_non_alphanumeric': 0.10056089743589744, 'fraction_numerical': 0.004807692307692308, 'mean_word_length': 3.857976653696498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2176681', 'n_tokens_mistral': 773, 'n_tokens_neox': 749, 'n_words': 334}