Skip to content

Commit

Permalink
Merge pull request #27 from Twi1ightSparkle/cronSampleMacNote
Browse files Browse the repository at this point in the history
  • Loading branch information
Twi1ightSparkle authored Dec 18, 2022
2 parents bc3006d + a24d362 commit 37de374
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Borg documentation: <https://borgbackup.readthedocs.io/en/stable/>
- Add a secure passphrase to the first line of the `borg_passphrase` file
- Edit `exclude.txt` and `include.txt` with your requirements. One entry per line
- From the root of the repo, run `./borg-wrapper.sh --init` to initialize the repo
- Use crontab (or the scheduler of your choice) to run `./borg-wrapper.sh --backup --automated --live` periodically
- Use crontab (or the scheduler of your choice) to run `./borg-wrapper.sh --backup --automated --live` periodically.
See `crontab_example` for an example configuration
- If you need to run multiple profiles, you can use the `--config` option to specify a different config directory

See [src/help.sh](https://github.com/Twi1ightSparkle/borg/blob/main/src/help.sh) for all command line options.
Expand Down Expand Up @@ -77,3 +78,11 @@ the Transformation JavaScript from `hookshot_webhook_js_transformation.js` to en
sure you give the webhook appservice user permissions to @room. However, this should work with any webhook reader that
accepts unauthenticated `PUT` JSON requests with the key `text`. To edit the behavior, edit the `webhook` function in
`src/utils.js` to fit your needs.

## Mac

On Mac, you must give `cron` full disk access.

- In the terminal, enter `open /usr/sbin`
- Go to `System Settings` -> `Privacy & Seurity` -> `Full Disk Access`
- From Finder, drag `cron` into the `Full Disk Access` window
27 changes: 27 additions & 0 deletions crontab_example
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Borg backup runner. Wrapper script for basic borg backup features.
# Copyright (C) 2022 Twilight Sparkle
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

# Make PATH available to the script
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow command

# Run backup every three hours
0 0,3,6,9,12,15,18,21 * * * /root/borg-wrapper/borg-wrapper.sh --config /root/borg-wrapper/config --backup --live --automated >> /root/borg-wrapper/config/cron_output.log

# Check the integrity of the backup repo twice a month at 4:30am
30 4 1,15 * * /root/borg-wrapper/borg-wrapper.sh --config /root/borg-wrapper/config --check --automated >> /root/borg-wrapper/config/cron_output.log

0 comments on commit 37de374

Please sign in to comment.