Clean up README formatting

This commit is contained in:
Kenneth Augdal 2025-10-11 19:52:42 +02:00
parent 19f6a04b51
commit 5d9286cf36

View file

@ -1,67 +1,67 @@
# Nextcloud Backup System
Automated Nextcloud backup solution using rclone to cloud storage (Jottacloud, Dropbox, Google Drive, etc).
Automated backup solution for Nextcloud using rclone.
## Features
- 🔒 **Secure**: No sudo required, runs as dedicated backup user
- 📦 **Hybrid Strategy**: Daily metadata backups + weekly/yearly full backups
- 🔄 **Automated**: Runs via cron
- ☁️ **Cloud Storage**: Uses rclone (supports 40+ cloud providers)
- 🗜️ **Compression**: Automatic tar.gz compression
- 📊 **Retention**: Configurable retention policies
- 🐳 **Docker Support**: Works with Dockerized Nextcloud
- No sudo required - runs as dedicated backup user
- Hybrid backup strategy: daily metadata + weekly/yearly full backups
- Automated scheduling via cron
- Works with rclone (supports 40+ cloud storage providers)
- Automatic tar.gz compression
- Configurable retention policies
- Docker support
## Quick Start
### Prerequisites
- Ubuntu/Debian Linux server
- Docker-based Nextcloud installation
- rclone installed and configured
- Dedicated backup user with proper group permissions
- Ubuntu/Debian server
- Docker-based Nextcloud
- rclone installed
- Dedicated backup user with group permissions
### Installation
1. **Create backup user**:
1. Create backup user:
```bash
sudo adduser --system --group --home /opt/backup backup-user
sudo usermod -aG www-data,docker backup-user
```
2. **Create directory structure**:
2. Create directory structure:
```bash
sudo mkdir -p /opt/backup/{bin,logs,backups}
sudo chown -R backup-user:backup-user /opt/backup
```
3. **Configure rclone** (as backup-user):
3. Configure rclone as backup-user:
```bash
sudo -u backup-user rclone config
```
4. **Install backup script**:
4. Install backup script:
```bash
sudo cp nextcloud-backup.sh /opt/backup/bin/
sudo chmod +x /opt/backup/bin/nextcloud-backup.sh
```
5. **Edit configuration** in script:
5. Edit configuration in script:
```bash
RCLONE_REMOTE="your-remote:YourPath/Nextcloud"
```
6. **Set read-only permissions** on Nextcloud data:
6. Set read-only permissions on Nextcloud data:
```bash
sudo chmod 750 /path/to/nextcloud/data
```
7. **Test backup**:
7. Test backup:
```bash
sudo -u backup-user /opt/backup/bin/nextcloud-backup.sh
```
8. **Schedule with cron**:
8. Schedule with cron:
```bash
sudo cp nextcloud-backup.cron /etc/cron.d/nextcloud-backup
```
@ -85,23 +85,18 @@ YEARLY_RETENTION=10 # Keep 10 yearly backups
## Backup Strategy
- **Daily** (03:15): Metadata only (database, config, apps) - ~100-200MB
- **Weekly** (Sunday): Complete backup including user data - several GB
- **Daily** (03:15): Metadata only (database, config, apps) - approximately 100-200MB
- **Weekly** (Sunday): Complete backup including user data
- **Yearly** (January 1st): Full archive for long-term storage
## Security Best Practices
## Security
**Recommended**: Use dedicated backup user (no sudo)
**Recommended approach**: Dedicated backup user without sudo privileges
- Read-only access to Nextcloud data
- Limited permissions
- Group-based access (www-data, docker)
- Limited permissions via group membership (www-data, docker)
- Reduced attack surface
**Not recommended**: Using sudo
- Excessive privileges
- Security risk
- Audit trail issues
See `nextcloud-backup-v1.sh` for legacy sudo-based approach (not recommended for new installations).
The legacy sudo-based approach is available in `nextcloud-backup-v1.sh` for reference but not recommended for new installations.
## Troubleshooting
@ -131,26 +126,26 @@ sudo usermod -aG docker backup-user
## Files
- `nextcloud-backup.sh` - Main backup script (v2, no sudo)
- `nextcloud-backup.sh` - Main backup script (no sudo required)
- `nextcloud-backup-v1.sh` - Legacy version with sudo (reference only)
- `nextcloud-backup.cron` - Cron schedule example
- `README.md` - This file
- `README.md` - Documentation
## Requirements
- **rclone** - Cloud storage sync tool
- **Docker** - For Nextcloud containers
- **tar** - Archive creation
- **gzip** - Compression
- rclone
- Docker
- tar
- gzip
## License
MIT License - Feel free to use and modify
MIT License
## Author
Created by IBICO74
IBICO74
## Support
For issues or questions, please open a GitHub issue.
Open a GitHub issue for questions or problems.