|
|
@ -81,12 +81,19 @@ def main(src_path: str, dest_path: str, src_php: str, dest_php: str, src_remote: |
|
|
|
max_users = len(users) |
|
|
|
max_users = len(users) |
|
|
|
|
|
|
|
|
|
|
|
for idx, user in enumerate(users): |
|
|
|
for idx, user in enumerate(users): |
|
|
|
|
|
|
|
src_user_files = f"{src_data}/{user}/files/" |
|
|
|
|
|
|
|
|
|
|
|
print(f"{'='*20}[{user} ({idx+1}/{max_users})]{'='*20}") |
|
|
|
print(f"{'='*20}[{user} ({idx+1}/{max_users})]{'='*20}") |
|
|
|
sys_stdout.flush() |
|
|
|
sys_stdout.flush() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check if user folder exist |
|
|
|
|
|
|
|
if run_command(["test", "-d", src_user_files], src_remote, ssh_args, check=False).returncode != 0: |
|
|
|
|
|
|
|
print("No files...") |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
run(["rsync", "-avzPh", "--del", |
|
|
|
run(["rsync", "-avzPh", "--del", |
|
|
|
"-e", f"ssh {' '.join(ssh_args)}", |
|
|
|
"-e", f"ssh {' '.join(ssh_args)}", |
|
|
|
f"{f'{src_remote}:' if src_remote else ''}{src_data}/{user}/files/", |
|
|
|
f"{f'{src_remote}:' if src_remote else ''}{src_user_files}", |
|
|
|
f"{f'{dest_remote}:' if dest_remote else ''}{dest_data}/{users[user]['email']}/"], |
|
|
|
f"{f'{dest_remote}:' if dest_remote else ''}{dest_data}/{users[user]['email']}/"], |
|
|
|
check=True, stdout=None, stderr=None) |
|
|
|
check=True, stdout=None, stderr=None) |
|
|
|
|
|
|
|
|
|
|
|