Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 1.38 KB

README.md

File metadata and controls

49 lines (36 loc) · 1.38 KB

Backup Script

Dependencies

  • borg
  • deno (installed automatically by the installation script)
  • rclone (optional, required if you want to use --sync)

Installation

By default the install script will install both deno and the backup script to /usr/local/bin, which usually requires running the script as root.

You can set BACKUP_INSTALL_DIR and BACKUP_SCRIPT_NAME to customise the install directory and script filename respectively. This can be used to install for a single user, so that you dont need root.

# install as root for all users
curl -fsSL https://raw.githubusercontent.com/luludotdev/backup/master/install.sh | sh
# install for the current user
export BACKUP_INSTALL_DIR="$HOME/.local/bin"
curl -fsSL https://raw.githubusercontent.com/luludotdev/backup/master/install.sh | sh

Usage

# show help
backup --help

# backup the contents of ~/Documents to ~/backup/documents
backup --name documents --repo ~/backup/documents --keep 7d ~/Documents

Cron

If running the script inside a cron job, make sure you add the deno, borg, and rclone binaries to cron daemon's PATH.

# add this line to your crontab before any backup jobs
PATH=$PATH:/usr/local/bin:/usr/bin