<commit_before>#!/bin/bash

function backup-remote-sites {
  set -e
  if [ ! -z $2 ] && [ -d "$1 $2" ]; then
    echo $1 $2
    cd "$1 $2"
  elif [ ! -z $1 ] && [ -d $1 ]; then
    echo $1
    cd $1
  fi

  if [ -f .env ]; then
    source .env
  else
    #Prompt user for settings
    while (true); do

      echo -n " # SSH HOST ($SSH_HOST): "
      read SSH_HOST_TEMP
      if [ ! -z ${SSH_HOST_TEMP} ]; then
        SSH_HOST=$SSH_HOST_TEMP
      fi

      echo -n " # SSH PORT ($SSH_PORT): "
      read SSH_PORT_TEMP
      if [ ! -z ${SSH_PORT_TEMP} ]; then
        SSH_PORT=$SSH_PORT_TEMP
      fi

      echo -n " # SSH USERNAME ($SSH_USERNAME): "
      read SSH_USERNAME_TEMP
      if [ ! -z ${SSH_USERNAME_TEMP} ]; then
        SSH_USERNAME=$SSH_USERNAME_TEMP
      fi

      echo -n " # Remote SSH domains root path ($REMOTE_SSH_ROOT_PATH): "
      read REMOTE_SSH_ROOT_PATH_TEMP
      if [ ! -z ${REMOTE_SSH_ROOT_PATH_TEMP} ]; then
        REMOTE_SSH_ROOT_PATH=$REMOTE_SSH_ROOT_PATH_TEMP
      fi

      echo -n " # Relative path to wordpress ($PATH_TO_WORDPRESS): "
      read PATH_TO_WORDPRESS_TEMP
      if [ ! -z ${PATH_TO_WORDPRESS_TEMP} ]; then
        PATH_TO_WORDPRESS=$PATH_TO_WORDPRESS_TEMP
      fi

      echo -n " # Relative path to drupal ($PATH_TO_DRUPAL): "
      read PATH_TO_DRUPAL_TEMP
      if [ ! -z ${PATH_TO_DRUPAL_TEMP} ]; then
        if [ -z ${PATH_TO_DRUPAL} ] && [ -f $POLY_SCRIPTS_FOLDER/.global-env ]; then
          echo "PATH_TO_DRUPAL=$PATH_TO_DRUPAL_TEMP" >> $POLY_SCRIPTS_FOLDER/.global-env
        fi
        PATH_TO_DRUPAL=$PATH_TO_DRUPAL_TEMP
      fi

      echo -n " # Relative path to exports ($PATH_TO_EXPORTS): "
      read PATH_TO_EXPORTS_TEMP
      if [ ! -z ${PATH_TO_EXPORTS_TEMP} ]; then
        PATH_TO_EXPORTS=$PATH_TO_EXPORTS_TEMP
      fi

      FOLDER="$(pwd)"
      echo -n "You are in folder $FOLDER. Do you want to continue? [y/n]: "
      read answer
      if [[ $answer == "y" ]]; then
        break;
      elif [[ $answer == "n" ]]; then
        exit;
      fi
    done

    echo "SSH_HOST=$SSH_HOST" > .env
    echo "SSH_PORT=$SSH_PORT" >> .env
    echo "SSH_USERNAME=$SSH_USERNAME" >> .env
    echo "REMOTE_DOMAIN=$DIR_NAME.$SSH_HOST" >> .env
    echo "PATH_TO_WORDPRESS=$PATH_TO_WORDPRESS" >> .env
    echo "PATH_TO_EXPORTS=$PATH_TO_EXPORTS" >> .env
    echo "PATH_TO_WORDPRESS=$PATH_TO_WORDPRESS" >> .env
    echo "PATH_TO_DRUPAL=$PATH_TO_DRUPAL" >> .env
  fi

  if [ ! -f sites.txt ]; then
    while (true); do

      echo -n " # Add remote site folder for backup: "
      read backup_site
      echo "$backup_site" >> sites.txt

      echo -n "Do you want to add another remote site for backup? [y/n]: "
      read answer
      if [[ $answer == "n" ]]; then
        break;
      fi

    done
  fi
  now="$(date +'%d/%m/%Y')"
  # trap 'echo "backup failed to complete" | mail -s "Backup at $now" "<EMAIL>"' INT TERM EXIT
<commit_msg>fix backup env set variables<commit_after>#!/bin/bash

function backup-remote-sites {
  set -e
  if [ ! -z $2 ] && [ -d "$1 $2" ]; then
    echo $1 $2
    cd "$1 $2"
  elif [ ! -z $1 ] && [ -d $1 ]; then
    echo $1
    cd $1
  fi

  if [ -f .env ]; then
    source .env
  else
    #Prompt user for settings
    while (true); do

      echo -n " # SSH HOST ($SSH_HOST): "
      read SSH_HOST_TEMP
      if [ ! -z ${SSH_HOST_TEMP} ]; then
        SSH_HOST=$SSH_HOST_TEMP
      fi

      echo -n " # SSH PORT ($SSH_PORT): "
      read SSH_PORT_TEMP
      if [ ! -z ${SSH_PORT_TEMP} ]; then
        SSH_PORT=$SSH_PORT_TEMP
      fi

      echo -n " # SSH USERNAME ($SSH_USERNAME): "
      read SSH_USERNAME_TEMP
      if [ ! -z ${SSH_USERNAME_TEMP} ]; then
        SSH_USERNAME=$SSH_USERNAME_TEMP
      fi

      echo -n " # Remote SSH domains root path ($REMOTE_SSH_ROOT_PATH): "
      read REMOTE_SSH_ROOT_PATH_TEMP
      if [ ! -z ${REMOTE_SSH_ROOT_PATH_TEMP} ]; then
        REMOTE_SSH_ROOT_PATH=$REMOTE_SSH_ROOT_PATH_TEMP
      fi

      echo -n " # Relative path to wordpress ($PATH_TO_WORDPRESS): "
      read PATH_TO_WORDPRESS_TEMP
      if [ ! -z ${PATH_TO_WORDPRESS_TEMP} ]; then
        PATH_TO_WORDPRESS=$PATH_TO_WORDPRESS_TEMP
      fi

      echo -n " # Relative path to drupal ($PATH_TO_DRUPAL): "
      read PATH_TO_DRUPAL_TEMP
      if [ ! -z ${PATH_TO_DRUPAL_TEMP} ]; then
        if [ -z ${PATH_TO_DRUPAL} ] && [ -f $POLY_SCRIPTS_FOLDER/.global-env ]; then
          echo "PATH_TO_DRUPAL=$PATH_TO_DRUPAL_TEMP" >> $POLY_SCRIPTS_FOLDER/.global-env
        fi
        PATH_TO_DRUPAL=$PATH_TO_DRUPAL_TEMP
      fi

      echo -n " # Relative path to exports ($PATH_TO_EXPORTS): "
      read PATH_TO_EXPORTS_TEMP
      if [ ! -z ${PATH_TO_EXPORTS_TEMP} ]; then
        PATH_TO_EXPORTS=$PATH_TO_EXPORTS_TEMP
      fi

      FOLDER="$(pwd)"
      echo -n "You are in folder $FOLDER. Do you want to continue? [y/n]: "
      read answer
      if [[ $answer == "y" ]]; then
        break;
      elif [[ $answer == "n" ]]; then
        exit;
      fi
    done

    echo "SSH_HOST=$SSH_HOST" > .env
    echo "SSH_PORT=$SSH_PORT" >> .env
    echo "SSH_USERNAME=$SSH_USERNAME" >> .env
    echo "REMOTE_SSH_ROOT_PATH=$REMOTE_SSH_ROOT_PATH" >> .env
    echo "PATH_TO_WORDPRESS=$PATH_TO_WORDPRESS" >> .env
    echo "PATH_TO_EXPORTS=$PATH_TO_EXPORTS" >> .env
    echo "PATH_TO_DRUPAL=$PATH_TO_DRUPAL" >> .env
  fi

  if [ ! -f sites.txt ]; then
    while (true); do

      echo -n " # Add remote site folder for backup: "
      read backup_site
      echo "$backup_site" >> sites.txt

      echo -n "Do you want to add another remote site for backup? [y/n]: "
      read answer
      if [[ $answer == "n" ]]; then
        break;
      fi

    done
  fi
  now="$(date +'%d/%m/%Y')"
  # trap 'echo "backup failed to complete" | mail -s "Backup at $now" "<EMAIL>"' INT TERM EXIT

{'fraction_non_alphanumeric': 0.1264705882352941, 'fraction_numerical': 0.0038062283737024223, 'mean_word_length': 2.3205054566341183, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, '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': '2861171', 'n_tokens_mistral': 2269, 'n_tokens_neox': 2220, 'n_words': 533}