Created
February 27, 2014 15:33
-
-
Save ffigiel/9252395 to your computer and use it in GitHub Desktop.
lftp sync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OLDSUM=0 | |
echo "$(tput setaf 3)`date +"%T"`: loading...$(tput sgr0)"; | |
while true ; do | |
sleep 1; | |
NEWSUM=`ls -laR | md5sum` | |
if [ "$OLDSUM" != "$NEWSUM" ] ; then | |
lftp YOUR_HOST -e 'mirror --use-cache --exclude-glob static/.sass-cache/ -R -v ~/YOUR_DIRECTORY / | |
bye'; | |
echo "$(tput setaf 3)`date +"%T"`: updated$(tput sgr0)" | |
fi | |
OLDSUM=$NEWSUM | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment