Skip to content

Instantly share code, notes, and snippets.

@kogakure
Created October 17, 2009 14:20
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kogakure/212350 to your computer and use it in GitHub Desktop.
Save kogakure/212350 to your computer and use it in GitHub Desktop.
Python: Fabric 0.9/1.x - Synchronize files with rsync
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Fabric 0.9/1.x – Synchronize files in a project folder with webserver
from fabric.api import env
from fabric.contrib.project import rsync_project
env.hosts = ['domain.com']
env.path = '/home/user/project/'
def sync():
"""
Synchronize project with webserver
"""
rsync_project(env.path, delete=True, exclude=['*.pyc','*.py','.DS_Store'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment