]> git.sesse.net Git - backup.sh/blobdiff - list-incr.sh
Add files that were never in RCS.
[backup.sh] / list-incr.sh
diff --git a/list-incr.sh b/list-incr.sh
new file mode 100755 (executable)
index 0000000..8bf99bf
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+DIR=$1
+LASTFULL=$(ls $DIR/full | tail -n1)
+if [ ! -f "$DIR/full/$LASTFULL" ]; then
+       echo "No full backup found"
+       echo "Usage example: $0 /backup/cirkus/_var_lib_postgresql"
+       exit 1
+fi
+# Get timestamp on form 2012-10-15 00:16
+LASTFULL_TIMESTAMP=$(echo `basename $LASTFULL .tgz` | sed -re 's/^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2}).*/\1-\2-\3 \4:\5/')
+find $DIR/full/$LASTFULL
+find $DIR/daglig -newermt "$LASTFULL_TIMESTAMP" -name '*.tgz'