Skip to content

Instantly share code, notes, and snippets.

@planetexpress69
Created December 23, 2015 09:31
Show Gist options
  • Save planetexpress69/bbe6e5f4f675c79aa0f2 to your computer and use it in GitHub Desktop.
Save planetexpress69/bbe6e5f4f675c79aa0f2 to your computer and use it in GitHub Desktop.
FTP on CLI for simple deployment
#!/bin/bash
HOST="your.host.name"
USER="username"
PASS="pasword"
FTPURL="ftp://$USER:$PASS@$HOST"
LCD="/Users/martin/Desktop/emberplayground/oi/dist"
RCD="/"
#DELETE="--delete"
lftp -c "set ftp:list-options -a;
open '$FTPURL';
lcd $LCD;
cd $RCD;
mirror --reverse \
$DELETE \
--verbose \
--exclude-glob a-dir-to-exclude/ \
--exclude-glob a-file-to-exclude \
--exclude-glob a-file-group-to-exclude* \
--exclude-glob other-files-to-exclude"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment