def download_backup():
    run('ls -t /usr/local/lib/backups | head -1')

def download_backup_ex1():
    global env
env.host_string = 'host1.example.com'
download_backup()

def download_backup_ex2():
    global env
env.host_string = 'host2.example.com'
download_backup()
How to target a different host inside a Fabric command