Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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. –  SvW 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
2  
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

1 Answer 1

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, env.host, deploy_to));
  else:
    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, env.host, deploy_to));


share|improve this answer

Your Answer

 
discard

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.