Re: backup con tar
Sono riuscito a riprodurre il problema e mi chiedo se sono io che
dimentico qualche parametro di tar oppure è proprio un baco... ma così
grave, mi sembra impossibile...
Comunque se volete provare anche voi questo script rivela il problema:
$ cat bin/tartest.sh
#!/bin/sh
dirtest=tartest
if [ -d "$dirtest" ]; then
echo please delete the folder $dirtest or change the variable
dirtest in this script.
exit 1
fi
# dir1/file1
mkdir -p "$dirtest/dir1"
touch "$dirtest/dir1/file1"
# dir2/file1
mkdir "$dirtest/dir2"
touch "$dirtest/dir2/file1"
# incrememental 0
tar cz -g "$dirtest"0 -f "$dirtest"0.tgz "$dirtest"
# delete of dir1
rm -rf "$dirtest/dir1"
# move of dir2 in dir1
mv "$dirtest/dir2" "$dirtest/dir1"
# incremental 1
cp "$dirtest"0 "$dirtest"1
tar cz -g "$dirtest"1 -f "$dirtest"1.tgz "$dirtest"
# remove of dirtest
rm -rf "$dirtest"
# restore from tar
tar xz -g /dev/null -f "$dirtest"0.tgz
tar xz -g /dev/null -f "$dirtest"1.tgz
Reply to: