complete README.md

This commit is contained in:
Marc Koch 2021-02-14 21:51:31 +01:00
parent ff585d4b0c
commit 9bf379a8eb
Signed by: marc
GPG Key ID: AC2D4E00990A6767
1 changed files with 75 additions and 19 deletions

View File

@ -1,23 +1,79 @@
# Nextcloud Docker Scripts # Nextcloud Docker Scripts
A collection of scripts to backup, upgrade and restore your docker nextcloud instances. I'd like to share my collection of scripts to back up, upgrade and restore Nextcloud Docker installations. They come
handy especially if you are managing multiple Nextcloud installations on your server.
## To Do's I am using the [Docker Homelab](https://github.com/cbirkenbeul/docker-homelab) for my Nextcloud instances.
- [x] implement backup **NOTE:**
- [x] multi instance backup **This scripts will only work if you...**
- [ ] user prompt to choose an instance for backup - have installed your Nextcloud within a Docker container
- [x] implement restore - are using a container for the Nextcloud app and a separate container for the MySQL database
- [x] multi instance restore - are using a docker-compose file to bring up both containers
- [x] user prompt to choose an instance for restore
- [x] implement upgrade **This scripts will only backup or restore the database and the config files of your Nextcloud installation!**
- [x] multi instance upgrade
- [ ] user prompt to choose an instance for upgrade ## Usage
- [ ] implement main menu
- [x] implement logging ### Install requirements
- [x] implement flags ```bash
- [x] no-output-flag pip3 install -r requirements.txt
- [x] no-logging-flag ```
- [x] no-cleanup-flag
- [x] no-confirmation-required-flag ### Configuration
- [ ] treat-all-instances-flag 1. Copy the `example_configuration.yml`.
```bash
cp example_configuration.yml configuration.yml
```
2. Adjust the `configuration.yml` with an editor of your choice.
### Back up a Nextcloud installation
The `backup.py` script will create a **backup of the database and the configuration** of your Nextcloud installations.
You can adjust the backup directory and the maximum number of backups in the `configuration.yml`.
```bash
python3 backup.py
```
or without user prompt
```bash
python3 backup.py cloud1 cloud2
```
### Restore a Nextcloud installation
The `restor.py` script will **restore the database and the configuration** of your Nextcloud installations.
```bash
python3 restore.py
```
or without user prompt
```bash
python3 restore.py cloud1 cloud2
```
### Upgrade a Nextcloud installation
The `upgrade.py` script will first back up and then try to upgrade your Nextcloud installations.
```bash
python3 upgrade.py
```
or without user prompt
```bash
python3 upgrade.py cloud1 cloud2
```
### Flags
| Flag | function |
|------|-----------------------------------------------------------------|
|--yes|won't ask for confirmation |
|--all|will treat all Nextcloud installations defined in the `config.yml`|
|--quiet|the script will produce no output on terminal |
|--nolog|no logs will be written |
|--nocleanup|there will be no cleanup of the backup directory afterwards |
|--nobackup|no backup will be made before upgrade |
## Known issues
- Sometimes the maintenance mode is not getting disabled properly after upgrades.
A simple `docker exec --user www-data <app-cotainer> php occ maintenance:mode --off` does the trick.