https://github.com/luludotdev/backup
quick and dirty backup script
https://github.com/luludotdev/backup
Last synced: 10 months ago
JSON representation
quick and dirty backup script
- Host: GitHub
- URL: https://github.com/luludotdev/backup
- Owner: luludotdev
- License: lgpl-3.0
- Created: 2024-03-11T01:34:54.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-15T20:16:55.000Z (over 1 year ago)
- Last Synced: 2025-02-06T21:31:55.387Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backup Script
## Dependencies
- [borg](https://borgbackup.readthedocs.io/en/stable/installation.html)
- [deno](https://docs.deno.com/runtime/manual/getting_started/installation)
(installed automatically by the installation script)
- [rclone](https://rclone.org/install/) (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.
```sh
# install as root for all users
curl -fsSL https://raw.githubusercontent.com/luludotdev/backup/master/install.sh | 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
```sh
# 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.
```sh
# add this line to your crontab before any backup jobs
PATH=$PATH:/usr/local/bin:/usr/bin
```