Skip to content
This repository was archived by the owner on Jan 12, 2022. It is now read-only.

Commit a529874

Browse files
committed
Minor adjustments
1 parent a56a99a commit a529874

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,47 +88,55 @@ The [Moodle eMailTest](https://moodle.org/plugins/local_mailtest) plugin is bake
8888
openssl req -x509 -newkey rsa:4096 -keyout moodle.key -out moodle.crt -days 365 -nodes -subj "/C=CA/ST=ON/L=Toronto/O=SC/OU=Org/CN=www.example.com"
8989
```
9090

91+
## Manual backups
92+
93+
On systems installed from .deb package, a cronjob should be automatically setup to perform backups. On a development system, you can manually run the same process:
94+
95+
```
96+
docker-compose run postgres-backup /bin/backup_db
97+
```
98+
9199
## Restoring a database backup
92100
93101
First, ensure you have a backup and delta to restore from! On systems installed from .deb package, the files are stored on the docker host under /backups by default.
94102
95103
Pause the backup cron on the docker host by commenting the job:
96104
97105
```
98-
# sed -i 's/^\([^#]\)/#\1/g' /etc/cron.d/postgres-backup
106+
sed -i 's/^\([^#]\)/#\1/g' /etc/cron.d/postgres-backup
99107
```
100108
101109
Switch to the moodle config folder:
102110
103111
```
104-
# cd /etc/moodle-docker
112+
cd /etc/moodle-docker
105113
```
106114
107115
Enable the site maintenance page:
108116
109117
```
110-
# docker-compose exec nginx-php-moodle /usr/bin/php /opt/moodle/app/admin/cli/maintenance.php --enable
118+
docker-compose exec nginx-php-moodle /usr/bin/php /opt/moodle/app/admin/cli/maintenance.php --enable
111119
```
112120
113121
Drop and re-create the database:
114122
115123
```
116-
# docker-compose run postgres-backup /bin/drop_and_create
124+
docker-compose run postgres-backup /bin/drop_and_create
117125
```
118126
119127
Restore the DB by running the script and answering the interactive prompts regarding which backup to restore:
120128
121129
```
122-
# docker-compose run postgres-backup /bin/restore_db_from_delta
130+
docker-compose run postgres-backup /bin/restore_db_from_delta
123131
```
124132
125133
Disable the site maintenance page:
126134
127135
```
128-
# docker-compose exec nginx-php-moodle /usr/bin/php /opt/moodle/app/admin/cli/maintenance.php --disable
136+
docker-compose exec nginx-php-moodle /usr/bin/php /opt/moodle/app/admin/cli/maintenance.php --disable
129137
```
130138
Unpause the backup:
131139
132140
```
133-
# sed -i 's/^#//g' /etc/cron.d/postgres-backup
141+
sed -i 's/^#//g' /etc/cron.d/postgres-backup
134142
```

0 commit comments

Comments
 (0)