Skip to content

Commit caab5d5

Browse files
committed
Add automated maintenance, fixes some warning in the admin panel
1 parent 6770bf7 commit caab5d5

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ init_diagram: |
145145
"nextcloud:latest" <- Base Images
146146
# changelog
147147
changelogs:
148+
- {date: "01.06.26:", desc: "Automated `occ` maintenance tasks on container start. Non time critical cron tasks run daily between 01:00 and 05:00 UTC."}
148149
- {date: "10.07.25:", desc: "Rebase to Alpine 3.22."}
149150
- {date: "12.02.25:", desc: "Rebase to Alpine 3.21."}
150151
- {date: "09.01.25:", desc: "Fix uploading large files. Existing users should update their nginx confs."}

root/etc/s6-overlay/s6-rc.d/init-nextcloud-config/run

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,16 @@ if occ config:system:get installed >/dev/null 2>&1; then
132132
if ! occ config:system:get datadirectory >/dev/null 2>&1; then
133133
occ config:system:set datadirectory --value='/data'
134134
fi
135+
if ! occ config:system:get maintenance_window_start >/dev/null 2>&1; then
136+
occ config:system:set maintenance_window_start --value=1 --type=integer
137+
fi
135138
if ! occ config:system:get upgrade.disable-web >/dev/null 2>&1; then
136139
occ config:system:set upgrade.disable-web --value=true --type=boolean
137140
fi
141+
142+
# Run maintenance steps, this also fixes warnings in the admin panel
143+
occ db:add-missing-indices
144+
occ maintenance:repair --include-expensive
138145
else
139146
echo "After completing the web-based installer, restart the Nextcloud container to apply default memory caching and transactional file locking configurations."
140147
echo "Alternatively, you can apply your own configurations by editing /config/www/nextcloud/config/config.php following the documentation:"

0 commit comments

Comments
 (0)