<commit_before>#!/usr/bin/env bash

# This file is managed by Puppet

if [ -z "$1" ]; then
  echo "usage: $0 <database>" 1>2&
  exit 1
fi

if [ "$EUID" -ne "0" ]; then
  echo "This script must be run as root." 1>2&
  exit 2
fi

DATABASE="$1"
DUMP_FILE="<%= @backup_dir %>/$DATABASE.sql.gz"
MYSQL_CREDENTIALS="--defaults-file=<%= @option_file %>"

ps cax | grep -q mysqld
if [ $? -eq 0 ]; then
  zcat "$DUMP_FILE" | mysql $MYSQL_CREDENTIALS -Bs -D $DATABASE
else
  echo "MySQL server not running - import of database ${DATABASE} aborted." 1>2&
  exit 3
fi<commit_msg>Purge output of service check<commit_after>#!/usr/bin/env bash

# This file is managed by Puppet

if [ -z "$1" ]; then
  echo "usage: $0 <database>" 1>2&
  exit 1
fi

if [ "$EUID" -ne "0" ]; then
  echo "This script must be run as root." 1>2&
  exit 2
fi

DATABASE="$1"
DUMP_FILE="<%= @backup_dir %>/$DATABASE.sql.gz"
MYSQL_CREDENTIALS="--defaults-file=<%= @option_file %>"

ps cax | grep -q mysqld > /dev/null
if [ $? -eq 0 ]; then
  zcat "$DUMP_FILE" | mysql $MYSQL_CREDENTIALS -Bs -D $DATABASE
else
  echo "MySQL server not running - import of database ${DATABASE} aborted." 1>2&
  exit 3
fi
{'fraction_non_alphanumeric': 0.1629310344827586, 'fraction_numerical': 0.02413793103448276, 'mean_word_length': 3.588932806324111, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 16, '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': '932345', 'n_tokens_mistral': 502, 'n_tokens_neox': 474, 'n_words': 152}