def transfer_website_bases(local_bases_path, user, servers, remote_bases_path, log_filename):
    folders = ['artigo', 'issue', 'newissue', 'title']

    for folder in folders:
        for server in servers:
            xc.run_remote_mkdirs(user, server, remote_bases_path + '/' + folder, log_filename)
            xc.run_scp(local_bases_path + '/' + folder, user, server, remote_bases_path, log_filename)
def transfer_issue_files(acron, issue_id, local_web_app_path, user, server, remote_web_app_path, log_filename):
    # 'rsync -CrvK img/* user@server:/var/www/...../revistas'
    issue_id_path = acron + '/' + issue_id

    folders = ['/htdocs/img/revistas/', '/bases/pdf/', '/bases/xml/']

    for folder in folders:
        dest_path = remote_web_app_path + folder + issue_id_path
        source_path = local_web_app_path + folder + issue_id_path
        xc.run_remote_mkdirs(user, server, dest_path, log_filename)
        xc.run_rsync(source_path, user, server, dest_path, log_filename)
Beispiel #3
0
def transfer_report_files(acron, issue_id, local_web_app_path, user, servers, remote_web_app_path):
    # 'rsync -CrvK img/* user@server:/var/www/...../revistas'
    issue_id_path = acron + '/' + issue_id

    folders = ['/htdocs/reports/']
    for folder in folders:
        dest_path = remote_web_app_path + folder + issue_id_path
        source_path = local_web_app_path + folder + issue_id_path
        log_filename = './transfer_report_' + issue_id_path.replace('/', '-') + '.log'
        for server in servers:
            xc.run_remote_mkdirs(user, server, dest_path, log_filename)
            xc.run_rsync(source_path, user, server, dest_path, log_filename)