Using get operation

The syntax for the Fabric get operation is as follows:

get(remote_path, local_path)

This will download the files from the remote host to the machine running the fabfile, using either rsync or scp . This is commonly used when you need to gather log files to the server, for example:

def get_ops():    try:        get("/var/log/messages","/root/")    except:        pass

Get Hands-On Enterprise Automation with Python. now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.