8u3631984
8u3631984

Reputation: 71

python copytree slower than bash rsync

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

Upvotes: 0

Views: 82

Answers (0)

Related Questions