def transfer(file):
from bible.utils import RSYNC
file_dir, filename = os.path.split(file)
remote_dir = '''/app/opbak/{}'''.format(TIME)
run(''' [ -d {0} ] || mkdir -p {0} '''.format(remote_dir))
#cmd = ''' {rsync} {file_dir}/{{{filename},md5.txt}} {ssh_user}@{target_host}:{remote_dir}/ '''.format(file_dir=file_dir, target_host=env.host_string, remote_dir=remote_dir, ssh_user=env.user, filename=filename, rsync=RSYNC)
#local(cmd)
with lcd(file_dir):
put(filename, remote_dir)
put('md5.txt', remote_dir)
with cd(remote_dir):
run('dos2unix md5.txt && md5sum -c md5.txt')
评论列表
文章目录