Updated documentation and fixed bug on extract function

This commit is contained in:
Marco Cetica 2023-03-20 11:42:51 +01:00
parent acff1370ce
commit d49ad449de
No known key found for this signature in database
GPG Key ID: 0EE8E2CF315D6F8E
4 changed files with 6 additions and 5 deletions

View File

@ -95,7 +95,7 @@ After that, you will find the final backup archive in `/home/john/backup-<HOSTNA
You can also use `backup.sh` from a crontab rule:
```sh
$> sudo crontab -e
30 03 * * 6 EKEY=$(cat /home/john/.ekey) /usr/local/bin/backup.sh -b /usr/local/etc/sources.bk /home/john $EKEY
30 03 * * 6 EKEY=$(cat /home/john/.ekey) bash -c '/usr/local/bin/backup.sh -b /usr/local/etc/sources.bk /home/john $EKEY' > /dev/null 2>&1
```

View File

@ -109,9 +109,10 @@ extract_backup() {
BACKUP_SH_ARCHIVE_PATH="$1"
BACKUP_SH_ARCHIVE_PW="$2"
openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 100000 -salt -d \
(openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 100000 -salt -d \
-in "$BACKUP_SH_ARCHIVE_PATH" \
-k "$BACKUP_SH_ARCHIVE_PW" | tar xvz
-k "$BACKUP_SH_ARCHIVE_PW" | tar xvz) > /dev/null 2>&1 \
|| (echo "Unable to extract backup." && exit 1)
}
helper() {

View File

@ -144,7 +144,7 @@ You can also use \f[B]backup.sh\f[R] from a crontab rule:
.nf
\f[C]
$> sudo crontab -e
30 03 * * 6 EKEY=$(cat /home/john/.ekey) /usr/local/bin/backup.sh -b /usr/local/etc/sources.bk /home/john $EKEY
30 03 * * 6 EKEY=$(cat /home/john/.ekey) bash -c \[aq]/usr/local/bin/backup.sh -b /usr/local/etc/sources.bk /home/john $EKEY\[aq] > /dev/null 2>&1
\f[R]
.fi
.PP

2
man.md
View File

@ -94,7 +94,7 @@ You can also use **backup.sh** from a crontab rule:
```
$> sudo crontab -e
30 03 * * 6 EKEY=$(cat /home/john/.ekey) /usr/local/bin/backup.sh -b /usr/local/etc/sources.bk /home/john $EKEY
30 03 * * 6 EKEY=$(cat /home/john/.ekey) bash -c '/usr/local/bin/backup.sh -b /usr/local/etc/sources.bk /home/john $EKEY' > /dev/null 2>&1
```
This will automatically run **backup.sh** every Saturday morning at 03:30 AM.