Skip to content

Instantly share code, notes, and snippets.

@blohinn
Created April 24, 2019 15:37
Show Gist options
  • Save blohinn/62a44763b478bde6e46659b5bab0f2d6 to your computer and use it in GitHub Desktop.
Save blohinn/62a44763b478bde6e46659b5bab0f2d6 to your computer and use it in GitHub Desktop.
Backup my project dir
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