https://github.com/jkaninda/s3safe
S3Safe is a simple and secure backup tool for S3 storage
https://github.com/jkaninda/s3safe
Last synced: 3 months ago
JSON representation
S3Safe is a simple and secure backup tool for S3 storage
- Host: GitHub
- URL: https://github.com/jkaninda/s3safe
- Owner: jkaninda
- License: mit
- Created: 2025-05-18T08:39:08.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-05-18T09:33:15.000Z (5 months ago)
- Last Synced: 2025-05-18T10:22:42.666Z (5 months ago)
- Language: Go
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# S3Safe - S3 Backup & Restore Tool
[](https://github.com/jkaninda/s3safe/releases)
[](https://goreportcard.com/report/github.com/jkaninda/s3safe)
[](https://pkg.go.dev/github.com/jkaninda/s3safe)
S3Safe is simple a lightweight CLI tool for backing up and restoring data from Amazon S3 and S3-compatible storage.
## Installation
```shell
# Using Go
go install github.com/jkaninda/s3safe@latest# Using Docker
docker pull jkaninda/s3safe:latest
```## Configuration
Copy `.env.example` to `.env` and configure your S3 credentials:```ini
AWS_REGION=us-east-1
AWS_ENDPOINT=https://s3.wasabisys.com
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_KEY=your_secret_key
AWS_BUCKET=your_bucket_name
AWS_FORCE_PATH="true" # For path-style URLs
AWS_DISABLE_SSL="false" # Set "true" for non-HTTPS endpoints
```## Command Reference
### Global Options
| Option | Short | Description |
|-------------------|-------|------------------------------------------------------|
| `--exclude` | `-e` | Exclude files/directories (comma-separated patterns) |
| `--recursive` | `-r` | Process directories recursively |
| `--path` | `-p` | Source directory path |
| `--dest` | `-d` | Destination path (in S3 or local filesystem) |
| `--file` | `-f` | Process single file instead of directory |
| `--ignore-errors` | `-i` | Continue on errors during restore |
| `--env-file` | | Custom environment file (default: .env) |
| `--help` | `-h` | Show help message |
| `--version` | `-v` | Show version information |### Backup Options
| Option | Short | Description |
|-----------------|-------|--------------------------------------------|
| `--compress` | `-c` | Compress before upload (creates .tar.gz) |
| `--timestamp` | `-t` | Add timestamp to compressed filename |### Restore Options
| Option | Short | Description |
|----------------|-------|-------------------------------------------------------------|
| `--decompress` | `-D` | Decompress after download |
| `--force` | | Force restore to destination path, overwrite existing files |## Usage Examples
### Backup Operations
**Backup directory (compressed):**
```shell
s3safe backup -p ./backups -d /s3path --compress --timestamp
```**Backup single file:**
```shell
s3safe backup --file data.db --dest /s3path/db-backups --compress
```**Non-compressed directory backup:**
```shell
s3safe backup -p ./backups -d /s3path/backups -r
```### Restore Operations
**Restore compressed backup:**
```shell
s3safe restore -p /s3path/backup.tar.gz -d ./backups --decompress
```**Restore directory (recursive):**
```shell
s3safe restore --path /s3path --dest ./backups --recursive
```### Docker Usage
**Backup with Docker:**
```shell
docker run --rm --env-file .env \
-v "./backups:/backups" \
jkaninda/s3safe:latest \
backup --path /backups -d s3path --compress
```**Restore with Docker:**
```shell
docker run --rm --env-file .env \
-v "./restored:/restored" \
jkaninda/s3safe:latest \
restore --path s3path/backup.tar.gz -d /restored --decompress
```## License
MIT License - See [LICENSE](LICENSE) for details.