Ответ 1
Вы можете использовать put
для этого (по крайней мере, в 1.0.0):
local_path
может быть относительным или абсолютным локальным файлом или каталогом и может содержать групповые символы оболочки, понятные Python glob. Также выполняется расширение Tilde (как реализовано os.path.expanduser).
Смотрите: http://docs.fabfile.org/en/1.0.0/api/core/operations.html#fabric.operations.put
Обновление: этот пример отлично работает (для меня) на 1.0.0.:
from fabric.api import env
from fabric.operations import run, put
env.hosts = ['[email protected]']
def copy():
# make sure the directory is there!
run('mkdir -p /home/frodo/tmp')
# our local 'testdirectory' - it may contain files or subdirectories ...
put('testdirectory', '/home/frodo/tmp')
# [[email protected]] Executing task 'copy'
# [[email protected]] run: mkdir -p /home/frodo/tmp
# [[email protected]] put: testdirectory/HELLO -> \
# /home/frodo/tmp/testdirectory/HELLO
# [[email protected]] put: testdirectory/WORLD -> \
# /home/frodo/tmp/testdirectory/WORLD
# ...