Crates.io | forge_backup |
lib.rs | forge_backup |
version | 1.0.0 |
source | src |
created_at | 2024-06-12 03:43:53.339207 |
updated_at | 2024-06-13 01:17:08.36936 |
description | A program to backup all the user home folders to an S3 bucket. |
homepage | |
repository | https://github.com/codemonkey76/rust_forge_backup |
max_upload_size | |
id | 1269207 |
size | 74,902 |
forge_backup
is a backup application for Linux servers. I developed this for Laravel Forge servers, however it will work with any linux server. It will backup each users home folder into a temp folder and then upload that to an AWS S3 Bucket, deleting the temp file on completion. It will also use Mailgun API to report any failures (or success by configuration).
libssl-dev
(on Debian-based systems) or openssl-devel
(on Amazon Linux)zip
aws-cli
aws configure
)To install the rust toolchain, run the following command
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
To install forge_backup
, ensure you have the Rust toolchain installed, then run:
cargo install forge_backup
To use forge_backup
, run the following command:
forge_backup [OPTIONS]
--temp-folder <TEMP_FOLDER>: Specify where to create the temp archives.
--s3-bucket <S3_BUCKET>: Specify the S3 bucket for backups.
--s3-folder <S3_FOLDER>: Specify the folder in the S3 bucket.
--home-dir <HOME_DIR>: Specify the home directory to back up (default: /home).
--notify-success <NOTIFY_SUCCESS>: Notify on success (possible values: true, false).
--alert-email <ALERT_EMAIL>: Email to alert in case of failure.
--exclude-users <EXCLUDE_USERS>: Users to exclude from backup.
--hostname
-h, --help: Print help information.
-V, --version: Print version information.
forge_backup --s3-bucket my-backup-bucket --s3-folder daily-backups --notify-success true --alert-email admin@example.com
You can create a configuration file at ~/.config/forge-backup/forge_backup.toml
. The command-line parameters will override the config file values. Following is a template for the config file.
exclude_users = []
exclude_files = [
"**/ai1m-backups/*",
"**/node_modules/*",
"**/.cache/*",
"**/.npm/*",
"**/vendor/*",
]
temp_folder = "~/tmp/backups"
home_dir = "/home"
hostname = "{$HOSTNAME}"
s3_bucket = ""
s3_folder = "daily"
alert_email = ""
notify_on_success = false
mailgun_api_base = ""
mailgun_api_key = ""
mailgun_domain = ""
sender_email = ""
Environment variables can be used in the config file like this:
hostname = "{$HOSTNAME}"
We welcome contributions. Please follow these guidelines:
This project is licensed under the MIT License.
If you encounter any issues or have feature requests, please submit them on our GitHub Issues page.
For any questions or support, please feel free to reach out via GitHub.
Thank you for using forge_backup
!