Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
Created June 12, 2015 14:18
Show Gist options
  • Save ZiTAL/bd4ef93d8172bb38bb0a to your computer and use it in GitHub Desktop.
Save ZiTAL/bd4ef93d8172bb38bb0a to your computer and use it in GitHub Desktop.
bash: get file from ftp
#!/bin/bash
host='127.0.0.1'
user='user'
passwd='passwd'
local_folder='/home/projects/example/public_html/application/views/layout/heavymetal'
remote_folder='/public_html/application/views/layout/heavymetal'
file='heavymetal_eu.php'
ftp -n $host <<END_SCRIPT
quote USER $user
quote PASS $passwd
lcd $local_folder
cd $remote_folder
get $file
quit
END_SCRIPT
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment