[Python] python copytree slower than bash rsync

Discussão em 'Python' iniciado por Stack, Março 1, 2025.

  1. Stack

    Stack Membro Participativo

    I try to write a python script to backup a network folder nearly 400 GB.

    This is my python code :

    shutil.copytree(source_folder, current_backup)


    The script stops after 7 hours without any error. So I tried

    cmd = "rsync -a " + source_folder + " " + current_backup
    os.system(cmd);


    The scrpt finished after 6 hours. It is alocal network But my question is : Why is the python method so extrem slower or stopps. Or is there a better way ? After coping the files and folders I want to create a zip archive. I will try to do this in one step

    Continue reading...

Compartilhe esta Página