You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Coop 582c76178c Switched back to lz4 compression. Other one was way to slow. 2 years ago
.eslintignore Updated for vanilla js 2 years ago
.eslintrc.js Fixed issue with .env when run from crontab. 2 years ago
LICENSE Initial commit 3 years ago
README.md Update README.md 2 years ago
borg.config.js Switched back to lz4 compression. Other one was way to slow. 2 years ago
devNotes.md Updated for vanilla js 2 years ago
index.js Fixed issue with .env when run from crontab. 2 years ago
package-lock.json Fixed issue with .env when run from crontab. 2 years ago
package.json Fixed issue with .env when run from crontab. 2 years ago

README.md

borg-backup-and-email

This runs borg backup and notifies you via email whether the backup succeeded or failed.

Note: this is not really intended to be used in production. Use this instead: https://github.com/vesparny/borgjs

Set up:
  1. Run npm i
  2. Install borg backup: apt install borgbackup
  3. Initialize an empty borg backup repository: borg init --encryption=repokey /path-to-backup/folder
  4. Save the passphrase you used
  5. Export the key and save that too: borg key export --paper /path-to-backup/folder ./key
  6. Add the backup repository path to both repository json keys in the borg.config.js file.
  7. Set the folders to backup in the borg.config.js file
  8. Create a .env file
  9. Set up email
    1. Add DESTINATION_EMAIL=foo@bar.com with your email address to the .env file
    2. Add MAILGUN_DOMAIN=foo.com with your mailgun domain to the .env file. Note: you can use the mailgun sandbox domain, just allow the email address you want the emails to be sent to - https://help.mailgun.com/hc/en-us/articles/217531258-Authorized-Recipients
    3. Add MAILGUN_PRIVATE_APIKEY=123 with mailgun private api key to the .env file
  10. Add your borg passphrase to the .env file: BORG_PASSPHRASE=foo
Checking things are backed up: