<commit_before>#!/usr/bin/env bash
SUBPROGRAM=osync
PROGRAM="$SUBPROGRAM-batch" # Batch program to run osync / obackup instances sequentially and rerun failed ones
AUTHOR="(L) 2013-2016 by <NAME>"
CONTACT="http://www.netpower.fr - <EMAIL>"
PROGRAM_BUILD=2016031301

## Runs an osync /obackup instance for every conf file found
## If an instance fails, run it again if time permits

## Configuration file path. The path where all the osync / obackup conf files are, usually /etc/osync or /etc/obackup
CONF_FILE_PATH=/etc/$SUBPROGRAM

## If maximum execution time is not reached, failed instances will be rerun. Max exec time is in seconds. Example is set to 10 hours.
MAX_EXECUTION_TIME=36000

## Specifies the number of reruns an instance may get
MAX_RERUNS=3

## Log file path
if [ -w /var/log ]; then
	LOG_FILE=/var/log/$SUBPROGRAM-batch.log
else
	LOG_FILE=./$SUBPROGRAM-batch.log
fi

# No need to edit under this line ##############################################################

function _logger {
	local value="${1}" # What to log
	echo -e "$value" >> "$LOG_FILE"

	if [ $_SILENT -eq 0 ]; then
		echo -e "$value"
	fi
}

function Logger {
	local value="${1}" # What to log
	local level="${2}" # Log level: DEBUG, NOTICE, WARN, ERROR, CRITIAL<commit_msg>Fixed silent option shouldn't exist in batch mode<commit_after>#!/usr/bin/env bash
SUBPROGRAM=osync
PROGRAM="$SUBPROGRAM-batch" # Batch program to run osync / obackup instances sequentially and rerun failed ones
AUTHOR="(L) 2013-2016 by <NAME>"
CONTACT="http://www.netpower.fr - <EMAIL>"
PROGRAM_BUILD=2016052501

## Runs an osync /obackup instance for every conf file found
## If an instance fails, run it again if time permits

## Configuration file path. The path where all the osync / obackup conf files are, usually /etc/osync or /etc/obackup
CONF_FILE_PATH=/etc/$SUBPROGRAM

## If maximum execution time is not reached, failed instances will be rerun. Max exec time is in seconds. Example is set to 10 hours.
MAX_EXECUTION_TIME=36000

## Specifies the number of reruns an instance may get
MAX_RERUNS=3

## Log file path
if [ -w /var/log ]; then
	LOG_FILE=/var/log/$SUBPROGRAM-batch.log
else
	LOG_FILE=./$SUBPROGRAM-batch.log
fi

# No need to edit under this line ##############################################################

function _logger {
	local value="${1}" # What to log
	echo -e "$value" >> "$LOG_FILE"
}

function Logger {
	local value="${1}" # What to log
	local level="${2}" # Log level: DEBUG, NOTICE, WARN, ERROR, CRITIAL
{'fraction_non_alphanumeric': 0.15353858456617353, 'fraction_numerical': 0.023590563774490203, 'mean_word_length': 4.584821428571429, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2918193', 'n_tokens_mistral': 863, 'n_tokens_neox': 786, 'n_words': 297}