From 0d01a9bbf313f2b3e53cf7584344251a0d8a4787 Mon Sep 17 00:00:00 2001 From: Marco Cetica Date: Mon, 13 Mar 2023 17:21:05 +0100 Subject: [PATCH] Added crontab documentation --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 19e62b1..d5fe0f6 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,17 @@ Elapsed time: 10 seconds. After that, you will find the final backup archive in `/home/john/backup--.tar.gz.enc`. +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 john $EKEY + +``` + +This will automatically run `backup.sh` every Saturday morning at 03:30 AM. In the example above, the encryption +key is stored in a local file(with fixed permissions) to avoid password leaking in crontab logs. You can also +adopt this practice while using the `--extract` option to avoid password leaking in shell history. + ### Archive extraction `backup.sh` can also extract the encrypted backup archive using the following syntax: