Skip to content

Instantly share code, notes, and snippets.

@fjkz
Created April 21, 2015 15:44
Show Gist options
  • Save fjkz/24aa77cf5b58fbdb881f to your computer and use it in GitHub Desktop.
Save fjkz/24aa77cf5b58fbdb881f to your computer and use it in GitHub Desktop.
FTP deployer
#!/usr/bin/env python
import argparse
from ftplib import FTP
host = 'HOSTNAME'
user = 'USERNAME'
passwd = 'PASSWORD'
parser = argparse.ArgumentParser(
description='Put a file to the FTP server.')
parser.add_argument('filename',
help='a file to be put')
filename = parser.parse_args().filename
ftp = FTP(host, user, passwd)
ftp.storbinary('STOR ' + filename, open(filename, 'r'))
ftp.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment