Skip to content

Instantly share code, notes, and snippets.

@lincank
Created May 24, 2013 18:39
Show Gist options
  • Save lincank/5645623 to your computer and use it in GitHub Desktop.
Save lincank/5645623 to your computer and use it in GitHub Desktop.
FTP sync with lftp
#!/bin/bash
HOST='web_host'
USER='foo'
PASS='pwd'
TARGETFOLDER='www'
SOURCEFOLDER='/path/to/something'
lftp -f "
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --reverse --delete --use-cache --verbose --only-newer $SOURCEFOLDER $TARGETFOLDER \
--exclude uploadfile --exclude .git
bye
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment