<commit_before>#!/bin/bash
if [ -z "$1" -o -z "$2" ]; then
  echo "This script requires that you pass in the src server and dest server to run."
  echo "Usage: ./rsync.sh SRC_SERVER DEST_SERVER"
  exit 1;
fi
SRC_SERVER=$1
DEST_SERVER=$2
# Available variables
#SRC_SERVER
#DEST_SERVER
echo "Source:"
echo $SRC_SERVER
echo "Dest:"
echo $DEST_SERVER
# Prerequisites
# We are SSH-ed into a remote host and calling this script on that host
# Communication on Port 22 is available
# The standard ubuntu AWS deploy key has been placed at /tmp/aws.pem
chmod 0400 /tmp/aws.pem

# Call rsync on the different nodes.
rsync -F --compress --archive --progress --stats --rsh 'ssh -i /tmp/aws.pem -o StrictHostKeyChecking=no' --rsync-path="sudo rsync" ubuntu@$SRC_SERVER:/etc/nginx/sites-available /etc/nginx/
rsync -F --compress --archive --progress --stats --rsh 'ssh -i /tmp/aws.pem -o StrictHostKeyChecking=no' --rsync-path="sudo rsync" ubuntu@$SRC_SERVER:/etc/nginx/sites-enabled /etc/nginx/
rsync -F --compress --archive --progress --stats --rsh 'ssh -i /tmp/aws.pem -o StrictHostKeyChecking=no' --rsync-path="sudo rsync" ubuntu@$SRC_SERVER:/var/www/ /var/

# Remove the SSH key
rm -rf /tmp/aws.pem<commit_msg>Adding some debug.<commit_after>#!/bin/bash
if [ -z "$1" -o -z "$2" ]; then
  echo "This script requires that you pass in the src server and dest server to run."
  echo "Usage: ./rsync.sh SRC_SERVER DEST_SERVER"
  exit 1;
fi
SRC_SERVER=$1
DEST_SERVER=$2
# Available variables
#SRC_SERVER
#DEST_SERVER
echo "Source:"
echo $SRC_SERVER
echo "Dest:"
echo $DEST_SERVER
# Prerequisites
# We are SSH-ed into a remote host and calling this script on that host
# Communication on Port 22 is available
# The standard ubuntu AWS deploy key has been placed at /tmp/aws.pem
chmod 0400 /tmp/aws.pem

# Call rsync on the different nodes.
echo "Copying /etc/nginx/sites-enabled..."
rsync -F --compress --archive --progress --stats --rsh 'ssh -i /tmp/aws.pem -o StrictHostKeyChecking=no' --rsync-path="sudo rsync" ubuntu@$SRC_SERVER:/etc/nginx/sites-available /etc/nginx/
echo "Copying /etc/nginx/sites-available..."
rsync -F --compress --archive --progress --stats --rsh 'ssh -i /tmp/aws.pem -o StrictHostKeyChecking=no' --rsync-path="sudo rsync" ubuntu@$SRC_SERVER:/etc/nginx/sites-enabled /etc/nginx/
echo "Copying /var/www..."
rsync -F --compress --archive --progress --stats --rsh 'ssh -i /tmp/aws.pem -o StrictHostKeyChecking=no' --rsync-path="sudo rsync" ubuntu@$SRC_SERVER:/var/www /var/

# Remove the SSH key
rm -rf /tmp/aws.pem
{'fraction_non_alphanumeric': 0.14081713605712018, 'fraction_numerical': 0.00872669575565252, 'mean_word_length': 3.6617375231053604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, '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': '28784', 'n_tokens_mistral': 945, 'n_tokens_neox': 879, 'n_words': 294}