0

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
3
  • 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, 2011 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, 2011 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, 2011 at 11:47

1 Answer 1

0

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));


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .