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)
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)