<commit_before>#!/bin/bash

# Configuration
###############

# where the backups will be uploaded
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_BUCKET=

# what to backup
SIMPLEDB_ACCESS_KEY_ID=
SIMPLEDB_SECRET_ACCESS_KEY=
SIMPLEDB_REGION=US_EAST
SIMPLEDB_DOMAINS=

# path to the backup jar
SDB_BACKUP_PATH=softwaremill-sdb-1-jar-with-dependencies.jar

#########

CURRENT_DATE=`date +"%d_%m_%Y"`
CURRENT_DATE_WITH_HOUR=`date +"%d_%m_%Y__%H_%M"`
TAR_FILE_NAME=simpledb_backup_${CURRENT_DATE_WITH_HOUR}.tar.gz

# Creating backup files
java -jar $SDB_BACKUP_PATH $SIMPLEDB_ACCESS_KEY_ID $SIMPLEDB_SECRET_ACCESS_KEY $SIMPLEDB_REGION $SIMPLEDB_DOMAINS

# Packing
tar -czf $TAR_FILE_NAME simpledb_backup*${CURRENT_DATE}*.txt

# Removing backup files
rm simpledb_backup*${CURRENT_DATE}*.txt

# Uploading to S3
java -cp $SDB_BACKUP_PATH pl.softwaremill.common.sdb.backup.S3Upload $S3_ACCESS_KEY_ID $S3_SECRET_ACCESS_KEY $S3_BUCKET $TAR_FILE_NAME<commit_msg>Fixing the script for the * domains case<commit_after>#!/bin/bash

# Configuration
###############

# where the backups will be uploaded
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_BUCKET=

# what to backup
SIMPLEDB_ACCESS_KEY_ID=
SIMPLEDB_SECRET_ACCESS_KEY=
SIMPLEDB_REGION=US_EAST
SIMPLEDB_DOMAINS=

# path to the backup jar
SDB_BACKUP_PATH=softwaremill-sdb-1-jar-with-dependencies.jar

#########

CURRENT_DATE=`date +"%d_%m_%Y"`
CURRENT_DATE_WITH_HOUR=`date +"%d_%m_%Y__%H_%M"`
TAR_FILE_NAME=simpledb_backup_${CURRENT_DATE_WITH_HOUR}.tar.gz

# Creating backup files
java -jar $SDB_BACKUP_PATH $SIMPLEDB_ACCESS_KEY_ID $SIMPLEDB_SECRET_ACCESS_KEY $SIMPLEDB_REGION "$SIMPLEDB_DOMAINS"

# Packing
tar -czf $TAR_FILE_NAME simpledb_backup*${CURRENT_DATE}*.txt

# Removing backup files
rm simpledb_backup*${CURRENT_DATE}*.txt

# Uploading to S3
java -cp $SDB_BACKUP_PATH pl.softwaremill.common.sdb.backup.S3Upload $S3_ACCESS_KEY_ID $S3_SECRET_ACCESS_KEY $S3_BUCKET $TAR_FILE_NAME
{'fraction_non_alphanumeric': 0.11620635747785305, 'fraction_numerical': 0.009379885356956748, 'mean_word_length': 8.320388349514563, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3008710', 'n_tokens_mistral': 828, 'n_tokens_neox': 821, 'n_words': 125}