Skip to content

Instantly share code, notes, and snippets.

@maddie927
Last active January 15, 2016 01:11
Show Gist options
  • Save maddie927/09e93a150445f208337d to your computer and use it in GitHub Desktop.
Save maddie927/09e93a150445f208337d to your computer and use it in GitHub Desktop.
export SSHKEY=[path to ssh key]
export CFDOMAIN=[xyz.com]
mkdir -p logs
rm -f filelist
alias do_ftp='sftp -q -b - -i $SSHKEY -P 2222 $CFDOMAIN\@[email protected]'
echo 'ls -1' | do_ftp | grep '^logs-' | awk '{print "get " $0 " logs/ \nrm " $0}' | do_ftp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment