Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone give me examples for the following scenarios on python fabric? I have been searching for weeks but just can not seem to get the right formula going.

I am trying to achieve the following:

  1. rsync a folder from local server to a remote server using a specific user and ssh keys
  2. Start a installation remotely (java app etc) as that user
share|improve this question
Maybe you should post what you tried unsuccessfully so someone can point you in the right direction. And you should accept answers to your older questions if they helped you. – Sven Nov 25 '11 at 11:25
Did you consider accepting some of the answers to your questions? This will encourage people to answer any new questions. – Khaled Nov 25 '11 at 11:25
my bad gentleman and yes you can laugh.. I didnt know how to accept answers.. NOW I do.. – Riaan Nov 25 '11 at 11:47

Here is a snippet of what I was playing with:

def deploy():
  if os.path.exists('%s/media' % os.getcwd()):
    print(green("Install Media Found..."))
    print('rsync -vazC --force --delete --exclude-from=%s/rsync_exclude.txt -e "ssh -p%s" %s/ %s@%s:%s' % (os.getcwd(), env.port, os.getcwd(), env.user,, deploy_to));
    print(red("Install Media Not Found!"))
    print('rsync -vazC --force --delete -e "ssh -p%s" %s/ %s@%s:%s' % (env.port, os.getcwd(), env.user,, deploy_to));

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.