Created
April 24, 2019 15:37
-
-
Save blohinn/62a44763b478bde6e46659b5bab0f2d6 to your computer and use it in GitHub Desktop.
Backup my project dir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
dirs = glob.glob('*/') | |
exclude = ['venvs', '_backups'] | |
for _dir in dirs: | |
if _dir[:-1] in exclude: | |
continue | |
os.system("rsync -av --progress {} ./_backups/ --exclude dockervolumedev --exclude dockervolumeprod --exclude .idea --exclude .git --exclude static --exclude media --exclude docker-volumes-dev --exclude docker-volumes-prod --exclude __pycache__ --exclude node_modules --exclude env --exclude venv".format(_dir[:-1])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment