https://github.com/computestacks/controller-backups
(MIRROR) Automated Controller Backups
https://github.com/computestacks/controller-backups
backup rclone
Last synced: 8 days ago
JSON representation
(MIRROR) Automated Controller Backups
- Host: GitHub
- URL: https://github.com/computestacks/controller-backups
- Owner: ComputeStacks
- Created: 2021-12-09T20:28:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-10T16:05:40.000Z (over 4 years ago)
- Last Synced: 2025-02-27T22:04:25.126Z (over 1 year ago)
- Topics: backup, rclone
- Language: Shell
- Homepage: https://git.cmptstks.com/cs-public/ops/controller-backups
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Automate ComputeStacks Controller Backups
This is a cron job that will automatically backup the controller database, retain a fixed number of backups, and optionally sync using rclone.
This will only backup the database, please be sure to separately take a backup of the `/etc/default/computestacks` file. This is only generated once during installation and will not change.
## Installation
### Install files and dependencies
This script will install our two scripts, and rclone.
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ComputeStacks/controller-backups/main/install.sh)"
```
### Configure rclone
Before proceeding, decide which storage system you will use: https://rclone.org/overview/
Use `rclone config` to setup and configure your storage system. Take note of the name you give your storage account.
### Configure backups
Add the following to `/etc/default/computestacks`, and make any necessary changes
```bash
LOCAL_BACKUPS_TO_KEEP=7
RCLONE_PROFILE= # This is the name you set when using `rclone config`.
RCLONE_REMOTE_PATH= # bucket name. May also include path in bucket, example: mybucket/somepath
```
### Setup cron
Use `crontab -e`
#### Examples
```
# Run everyday at 03:30
30 3 * * * /usr/local/bin/controller-backup >> /var/log/rclone/controller-backup.log 2>&1
```
```
# Run every 12 hours
0 */12 * * * /usr/local/bin/controller-backup >> /var/log/rclone/controller-backup.log 2>&1
```