Skip to content

Instantly share code, notes, and snippets.

@DarrylDias
Created January 16, 2014 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarrylDias/8459669 to your computer and use it in GitHub Desktop.
Save DarrylDias/8459669 to your computer and use it in GitHub Desktop.
Sync folder using Lftp. you need to install Lftp to use this script on you system
#!/bin/bash
HOST='yourwebsite.com'
USER='your_username_here'
PASS='your_password_here'
TARGETFOLDER='/remote_folder'
SOURCEFOLDER='/home/myuser/local_folder'
lftp -f "
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --reverse --delete --verbose $SOURCEFOLDER $TARGETFOLDER
bye
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment