]> git.sesse.net Git - backup.sh/blob - list-incr.sh
Englishify a bit.
[backup.sh] / list-incr.sh
1 #!/bin/bash
2
3 DIR=$1
4 LASTFULL=$(ls $DIR/full | tail -n1)
5 if [ ! -f "$DIR/full/$LASTFULL" ]; then
6         echo "No full backup found"
7         echo "Usage example: $0 /backup/cirkus/_var_lib_postgresql"
8         exit 1
9 fi
10 # Get timestamp on form 2012-10-15 00:16
11 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/')
12 find $DIR/full/$LASTFULL
13 find $DIR/daglig -newermt "$LASTFULL_TIMESTAMP" -name '*.tgz'