June 2018
Intermediate to advanced
398 pages
9h
English
The syntax for the Fabric put operation is as follows:
put(local_path, remote_path, use_sudo=False, mirror_local_mode=False, mode=None)
This operation will upload the file from the machine running the fabfile (local) to the remote host. Using use_sudo will solve the permissions issue when you upload to the root directory. Also, you can keep the current file permissions on both the local and remote server, or you can set new permissions:
def put_ops(): try: put("/root/VeryImportantFile.txt","/root/") except: pass
Read now
Unlock full access