Skip to content

Instantly share code, notes, and snippets.

@doublecompile
Created July 18, 2015 21:35
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 doublecompile/5097545a11b4aa5f08a2 to your computer and use it in GitHub Desktop.
Save doublecompile/5097545a11b4aa5f08a2 to your computer and use it in GitHub Desktop.
TiddlyWiki 5 Backup Script
#!/bin/bash
TIDDLY_HTML="$HOME/tiddly.html"
TIDDLY_BACK="$HOME/.tiddly"
lastback=`ls -Frt $TIDDLY_BACK | grep "[^/]$" | tail -n 1`
hash1=`md5sum $TIDDLY_BACK/$lastback | awk '{ print $1 }'`
hash2=`md5sum $TIDDLY_HTML | awk '{ print $1 }'`
if [ "$hash1" != "$hash2" ] ; then
dest=`date -u "+%Y%m%d.%H%M%S%3N"`;
cp "$TIDDLY_HTML" "$TIDDLY_BACK/tiddly.$dest.html"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment