Change snapshot mode, owner and group. Preserve attributes on copy
This commit is contained in:
parent
ac8bcf8046
commit
3d83b32edd
|
@ -39,12 +39,12 @@ tar -cz \
|
||||||
-g $BACKUPS/$TYPE.snapshot \
|
-g $BACKUPS/$TYPE.snapshot \
|
||||||
-f $BACKUPS/$DATE-$TYPE.tgz
|
-f $BACKUPS/$DATE-$TYPE.tgz
|
||||||
|
|
||||||
chown root:sudo $BACKUPS/$DATE*.tgz
|
chown root:sudo $BACKUPS/{$DATE*.tgz,$TYPE.snapshot}
|
||||||
chmod 640 $BACKUPS/*.tgz
|
chmod 640 $BACKUPS/{*.tgz,$TYPE.snapshot}
|
||||||
|
|
||||||
if [ $TYPE = full ]
|
if [ $TYPE = full ]
|
||||||
then
|
then
|
||||||
cp $BACKUPS/full.snapshot $BACKUPS/incremental.snapshot
|
cp -p $BACKUPS/full.snapshot $BACKUPS/incremental.snapshot
|
||||||
# Remove dumps and the previous backup if there is another one.
|
# Remove dumps and the previous backup if there is another one.
|
||||||
[ -e $LEVEL0 ] && rm $LEVEL0 $BACKUPS/*incremental.tgz
|
[ -e $LEVEL0 ] && rm $LEVEL0 $BACKUPS/*incremental.tgz
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue