Created
April 21, 2015 15:44
-
-
Save fjkz/24aa77cf5b58fbdb881f to your computer and use it in GitHub Desktop.
FTP deployer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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