Skip to content

Instantly share code, notes, and snippets.

@libryder
Created February 20, 2012 16:55
Show Gist options
  • Select an option

  • Save libryder/1870096 to your computer and use it in GitHub Desktop.

Select an option

Save libryder/1870096 to your computer and use it in GitHub Desktop.
Easily push and pull files between servers
file=$1
server=server.com
user=user
pass=pass
bucket=/uploads
dl_location=http://host.com
function push_file() {
ftp -invp "$server"<<ENDOFUPLOAD
user $user $pass
cd $bucket
put $file
bye
ENDOFUPLOAD
}
function fetch_file() {
wget "$dl_location"$1 ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment