https://github.com/purarue/raspi-backup
script to periodically back up my machine to my raspberry pi
https://github.com/purarue/raspi-backup
backup backup-utility cli networking raspberry-pi rsync
Last synced: about 1 year ago
JSON representation
script to periodically back up my machine to my raspberry pi
- Host: GitHub
- URL: https://github.com/purarue/raspi-backup
- Owner: purarue
- License: apache-2.0
- Archived: true
- Created: 2020-07-15T23:16:56.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-27T20:19:28.000Z (over 1 year ago)
- Last Synced: 2025-02-08T23:34:12.704Z (over 1 year ago)
- Topics: backup, backup-utility, cli, networking, raspberry-pi, rsync
- Language: Shell
- Homepage:
- Size: 48.8 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# raspi-backup
Script to periodically back up my machine to my raspberry pi backup server. Is pretty minimal, just uses headless raspbian with an external 4TB that gets mounted on boot. See [here](https://purarue.xyz/x/tech_hardware/raspi/) for notes I took while setting that up.
Does an `rsync` without deleting files on the remote system, provide the `-n`/`-d` flags for:
```
Backs up my system to my local raspberry pi over the network
Provide the -n option to do a --dry-run
Provide the -d option to delete any files not present on this system (--delete-before rsync flag)
```
This assumes that an `ssh` key has already been setup, that `ssh pi@` should work without a password prompt.
The `.txt` files in this directory specify which files to back up.
Expects a `RASPI_MAC_ADDR` environment variable to be set, which is used with `arp -a` to get the IP address of the pi by using the mac address. You can get the mac address by running `arp -a` and comparing the IPs with the info from running `ifconfig` on the pi. Can also `export` the `RASPI_MAC_ADDR` from a file in this directory, `./mac_addr`, like:
```
#!/bin/sh
export RASPI_MAC_ADDR="b8:27:eb:3d:42:dc"
```
### Run
Run `./findpi` to make sure the pi is discoverable. Modify `configure` if necessary (to change the target directory/username). Modify the include/exclude `.txt` files to backup what you want to backup.
`./backup`
### Requirements
- `arp`
- `rsync`
- `getopts`
- `realpath`
- `nmap`