The following script fails to perform incremental backup, but creates full backup instead.
On another FreeBSD server exactly same script works just fine (creating incremental backups).
Servers are identical, same FreeBSD 10.0-RELEASE on both machines. Script it exactly the same. Version of gtar is identical. File system is identical.
Not sure what's going on. Searched for days! Please help.
#!/bin/sh
sourcedir="/home"
targetdir="/backup/home"
now=$(date +"%Y%m%d%H%M")
cd $sourcedir
for dir in */
do
base=$(basename "$dir")
gtar -cz -g "$targetdir/.gtar-incremental" -f "$targetdir/${base}-$now.tar.gz" "/home/$dir"
chmod 600 "$targetdir/${base}-$now.tar.gz"
done
gtar -cz -G "$targetdir/.gtar-incremental" -f "$targetdir/${base}-$now.tar.gz" "/home/$dir"
. Let us know how it went. A couple of examples I've seen suggest that[ -g, --listed-incremental F ] [ -G, --incremental ]
gtar manualfor dir in */
loop, when I remove that and specify each directory/file - incremental works! Can you help? In addition to your comment-G
can't take any arguments, it does not create a snapshot file.