<commit_before>import spur
import os
from subprocess import call
from overlord import celery


@celery.task
def backup_bd_MySQL():
    shell = spur.SshShell(
        hostname=os.environ['TNYU_BD_SERVER_IP'],
        username=os.environ['TNYU_BD_SERVER_USER'],
        password=os.environ['TNYU_BD_SERVER_PASSWORD'],
        missing_host_key=spur.ssh.MissingHostKey.accept,
    )
    with shell:
        passwordCombination = "-p" + os.environ['TNYU_BD_MYSQL_PASSWORD']
        shell.run(["mysqldump", "zurmo", "-u", "zurmo", passwordCombination,
                   ">", "/root/backups/sql.sql"], cwd="/root/backups", allow_error=True)
        shell.run(["git", "add", "."], cwd="/root/backups", allow_error=True)
        shell.run(["git", "commit", "-am", '"Adding Updates"'],
                  cwd="/root/backups", allow_error=True)
        result = shell.run(["git", "push", "-u", "origin",
                            "master"], cwd="/root/backups", allow_error=True)
    if result.return_code > 4:
        return False
    return True


@celery.task
def backup_mongo():
    shell = spur.SshShell(
        hostname=os.environ['TNYU_API_SERVER_IP'],
        username=os.environ['TNYU_API_SERVER_USER'],
        password=os.environ['<PASSWORD>_API_SERVER_PASSWORD'],
        missing_host_key=spur.ssh.MissingHostKey.accept,
    )
    with shell:
        shell.run(["rm", "-rf", "dump"], cwd="/backup", allow_error=True)
        shell.run(["mkdir", "dump"], cwd="/backup", allow_error=True)
        shell.run(["mongodump", "-h", "localhost", "-o", "dump",
                   "-d", "platform"], cwd="/backup", allow_error=True)
        shell.run(["git", "add", "."], cwd="/backup", allow_error=True)
        shell.run(["git", "commit", "-am", '"Adding Updates"'],
                  cwd="/backup", allow_error=True)
        result = shell.run(["git", "push", "-u", "origin",
                            "master"], cwd="/backup", allow_error=True)
    if result.return_code > 4:
        return False
    return True


@celery.task
def backup_jira():
    shell = spur.SshShell(
        hostname=os.environ['TNYU_Jira_SERVER_IP'],
        username=os.environ['TNYU_Jira_SERVER_USER'],<commit_msg>Fixing merge<commit_after>import spur
import os
from subprocess import call
from overlord import celery


@celery.task
def backup_bd_MySQL():
    shell = spur.SshShell(
        hostname=os.environ['TNYU_BD_SERVER_IP'],
        username=os.environ['TNYU_BD_SERVER_USER'],
        password=<PASSWORD>['<PASSWORD>'],
        missing_host_key=spur.ssh.MissingHostKey.accept,
    )
    with shell:
        passwordCombination = "-p" + os.environ['TNYU_BD_MYSQL_PASSWORD']
        shell.run(["mysqldump", "zurmo", "-u", "zurmo", passwordCombination,
                   ">", "/root/backups/sql.sql"], cwd="/root/backups", allow_error=True)
        shell.run(["git", "add", "."], cwd="/root/backups", allow_error=True)
        shell.run(["git", "commit", "-am", '"Adding Updates"'],
                  cwd="/root/backups", allow_error=True)
        result = shell.run(["git", "push", "-u", "origin",
                            "master"], cwd="/root/backups", allow_error=True)
    if result.return_code > 4:
        return False
    return True


@celery.task
def backup_mongo():
    shell = spur.SshShell(
        hostname=os.environ['TNYU_API_SERVER_IP'],
        username=os.environ['TNYU_API_SERVER_USER'],
        password=os.environ['TNYU_API_SERVER_PASSWORD'],
        missing_host_key=spur.ssh.MissingHostKey.accept,
    )
    with shell:
        shell.run(["rm", "-rf", "dump"], cwd="/backup", allow_error=True)
        shell.run(["mkdir", "dump"], cwd="/backup", allow_error=True)
        shell.run(["mongodump", "-h", "localhost", "-o", "dump", "-u", os.environ['TNYU_API_MONGO_USER'],
                   '-p', os.environ['TNYU_API_MONGO_PW']], cwd="/backup", allow_error=True)
        shell.run(["git", "add", "."], cwd="/backup", allow_error=True)
        shell.run(["git", "commit", "-am", '"Adding Updates"'],
                  cwd="/backup", allow_error=True)
        result = shell.run(["git", "push", "-u", "origin",
                            "master"], cwd="/backup", allow_error=True)
    if result.return_code > 4:
        return False
    return True


@celery.task
def backup_jira():
    shell = spur.SshShell(
        hostname=os.environ['TNYU_Jira_SERVER_IP'],
        username=os.environ['TNYU_Jira_SERVER_USER'],
{'fraction_non_alphanumeric': 0.17405063291139242, 'fraction_numerical': 0.0009041591320072332, 'mean_word_length': 2.915929203539823, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 12, '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': '6229738', 'n_tokens_mistral': 1509, 'n_tokens_neox': 1484, 'n_words': 246}