use relative paths for tarball for proper extraction
This commit is contained in:
parent
c8ef3d4eb4
commit
a7c0eccde5
@ -32,14 +32,16 @@ Create a cronjob or execute the following script manually:
|
||||
|
||||
### Restore last backup
|
||||
|
||||
Important: This overwrites all files without prompting!
|
||||
|
||||
```
|
||||
tar -xvf backup/var/latest.tar
|
||||
tar -xf backup/var/latest.tar -C /home/project/base/dir/
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
tar -xzvf backup/var/var.tar.2025-01-01.gz
|
||||
tar -xzf backup/var/var.tar.2025-01-01.gz -C /home/project/base/dir/
|
||||
```
|
||||
|
||||
## Customizing
|
||||
|
@ -38,7 +38,7 @@ if [ ! -f "${CONFDIR}rotatemap_var.conf" ]; then
|
||||
fi
|
||||
|
||||
[ -z ${isSilent} ] && echo "pack var directory"
|
||||
tar --numeric-owner --absolute-names -cf ${BACKUPDIR}new.tar ${BASEDIR}/var;
|
||||
tar --numeric-owner -cf ./backup/var/new.tar -C ${BASEDIR} var
|
||||
|
||||
if [ ! -f "${BACKUPDIR}latest.tar" ] || [ "$(cmp ${BACKUPDIR}latest.tar ${BACKUPDIR}new.tar)" ]; then
|
||||
cp ${BACKUPDIR}new.tar ${BACKUPDIR}latest.tar && mv ${BACKUPDIR}new.tar ${BACKUPDIR}var.tar && /usr/sbin/logrotate -fs ${CONFDIR}rotatemap_var.state ${CONFDIR}rotatemap_var.conf
|
||||
|
Loading…
x
Reference in New Issue
Block a user