Skip to content

Instantly share code, notes, and snippets.

@ffigiel
Created February 27, 2014 15:33
Show Gist options
  • Save ffigiel/9252395 to your computer and use it in GitHub Desktop.
Save ffigiel/9252395 to your computer and use it in GitHub Desktop.
lftp sync
#!/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