I am a python newbie. My question is what approach I should use to set up a file/directory backup routine, as described below (os.walk or filecmp.dircmp, or something else).
I want to set up a backup routine as follows:
Every night, I want to make "bakup_dir_a1" (and all its subdirectories) into a mirror of "local_dir_a" (and all its subdirectories); But, each night . . .
First, I want to compare local_dir_a (and all its subdirectories) to bakup_dir_a1 (and all its subdirectories), to identify differences.
Next, I want to create a list of files (full path including filename) in bakup_dir_a1 (and all its subdirectories), that will be replaced by newer files copied from local_dir_a (and all its subdirectories), and the respective last-modified dates of the newer and the older files;
Next, I want to create a list of files (full path including filename) in bakup_dir_a1 (and all its subdirectories), that will be simply deleted from bakup_dir_a (and all its subdirectories);
Next, I want to create an archive (.rar or .zip) in bakup_dir_a2 containing a copy of all the files identified in paragraphs no. 3 and no. 4 above.
Lastly, I will execute the mirroring described in paragraph 1 above.
I've spent some time trying to learn how to work with os.walk and filecmp.dircmp.
I suspect that os.walk might be the better device to use for my purposes.
Any suggestions would be much appreciated. Thanks, Marc