Hi! I'm running tar 1.18 on kernel 2.6.22-14 and trying to perform incremental backups with script below, levels 0, 1 & 2. Every time I create a level 2 after creating a level 0 it just does a full level 0 again but the file size is slightly larger than the original level 0. It's acting really weird. If I perform backup of /home which is 14GB then it performs full backups even when doing level 2. If I change *only* the directory in the script to tar /home/andrew/test, and perform backup level 0 then add files/change files etc, then level 2 works perfectly. Why is it failing on larger inputs?
Second issue is that tar --list archive.tar is not working for me at
all. It just hangs until ctrl-c is pressed. Is it supposed to output
to stdout?
I run script as follows:
sudo ./backup 0
sudo ./backup 1
or
sudo ./backup 2
my script:
#!/bin/bash
case $1 in
0)
echo "Executing a level 0 backup request"
LVL=lvl0
rm -f /var/log/backups/snar*
SNARFILE=/var/log/backups/snar
;;
1)
echo "Executing a level 1 backup request"
LVL=lvl1
cp -p /var/log/backups/snar /var/log/backups/snar-1
SNARFILE=/var/log/backups/snar-1
;;
2)
echo "Executing a level 2 backup request"
LVL=lvl2
cp -pu /var/log/backups/snar /var/log/backups/snar-1
cp -p /var/log/backups/snar-1 /var/log/backups/snar-2
SNARFILE=/var/log/backups/snar-2
;;
esac
STAMP=$(date +%Y-week%V-%a)
TARGET_DIR=/home
LOGDIR=/var/log/backups
HOST=`hostname`
tar -cvPf \
${TARGET_DIR}/${LVL}-${STAMP}.tar \
--listed-incremental ${SNARFILE} \
/home \
>> ${LOGDIR}/${LVL}-${STAMP}.log
--
GnuPG Key ID: ECB18ABA
Fingerprint: FDF3 91FC F5BC 1164 E217 315E 337E 219B ECB1 8ABA
signature.asc
Description: PGP signature
