Updated documentation and fixed bug on extract function
This commit is contained in:
parent
acff1370ce
commit
d49ad449de
@ -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:
|
You can also use `backup.sh` from a crontab rule:
|
||||||
```sh
|
```sh
|
||||||
$> sudo crontab -e
|
$> 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
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -109,9 +109,10 @@ extract_backup() {
|
|||||||
BACKUP_SH_ARCHIVE_PATH="$1"
|
BACKUP_SH_ARCHIVE_PATH="$1"
|
||||||
BACKUP_SH_ARCHIVE_PW="$2"
|
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" \
|
-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() {
|
helper() {
|
||||||
|
@ -144,7 +144,7 @@ You can also use \f[B]backup.sh\f[R] from a crontab rule:
|
|||||||
.nf
|
.nf
|
||||||
\f[C]
|
\f[C]
|
||||||
$> sudo crontab -e
|
$> 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]
|
\f[R]
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
|
2
man.md
2
man.md
@ -94,7 +94,7 @@ You can also use **backup.sh** from a crontab rule:
|
|||||||
|
|
||||||
```
|
```
|
||||||
$> sudo crontab -e
|
$> 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.
|
This will automatically run **backup.sh** every Saturday morning at 03:30 AM.
|
||||||
|
Loading…
Reference in New Issue
Block a user