Skip to content

Instantly share code, notes, and snippets.

@abronte
Created April 5, 2012 00:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abronte/2306690 to your computer and use it in GitHub Desktop.
Save abronte/2306690 to your computer and use it in GitHub Desktop.
LFTP sync
#!/bin/bash
HOST="email.com:1234"
USER="username"
PASS="password"
LCD="/path/to/local/dir"
RCD="/path/to/remote/dir"
if [ ! -e "/tmp/xfer" ]
then
touch /tmp/xfer
lftp -c "set ftp:list-options -a;
open ftp://$USER:$PASS@$HOST;
lcd $LCD;
cd $RCD;
mirror --delete \
--only-missing \
--verbose"
rm /tmp/xfer
else
echo "Xfering already going"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment