mirror of
https://github.com/RipleyBooya/Nextcloud-AIO_OnlyOffice_Availability_Fix.git
synced 2025-12-11 05:08:39 +01:00
Compare commits
5 commits
f220a4361f
...
ef9f32941c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef9f32941c | ||
|
|
e1d727456d | ||
|
|
5cd02fbaa3 | ||
|
|
a41cedb184 | ||
|
|
422ba72e7c |
5 changed files with 75 additions and 3 deletions
17
README.md
17
README.md
|
|
@ -50,10 +50,21 @@ This document proposes a complete, reliable, automated workaround.
|
|||
|
||||
## Summary of the Solution
|
||||
|
||||
### 0. (Optional) Set “Availability check interval” to **0 minutes**
|
||||
In the ONLYOFFICE admin panel:
|
||||
|
||||
**Settings → ONLYOFFICE → Availability check interval → set to `0`**
|
||||
### 0. (Optional) Set “editors_check_interval” to **0** via OCC
|
||||
|
||||
There is no GUI option anymore for this in the ONLYOFFICE admin panel,
|
||||
so you have to use the CLI (occ) inside the Nextcloud container:
|
||||
|
||||
```bash
|
||||
docker exec -it nextcloud-aio-nextcloud \
|
||||
sudo -E -u www-data php occ config:system:set onlyoffice editors_check_interval --value=0
|
||||
|
||||
docker exec -it nextcloud-aio-nextcloud \
|
||||
sudo -E -u www-data php occ config:system:get onlyoffice editors_check_interval
|
||||
```
|
||||
|
||||
|
||||
|
||||
This reduces periodic background checks,
|
||||
**BUT on its own it does *not* fix the nightly-backup issue.**
|
||||
|
|
|
|||
10
etc/logrotate.d/onlyoffice-auto-fix
Normal file
10
etc/logrotate.d/onlyoffice-auto-fix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/var/log/onlyoffice-auto-fix.log {
|
||||
daily
|
||||
rotate 90
|
||||
size 5M
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
}
|
||||
7
etc/systemd/system/onlyoffice-fix.service
Normal file
7
etc/systemd/system/onlyoffice-fix.service
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[Unit]
|
||||
Description=Auto-fix OnlyOffice for Nextcloud AIO
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/sbin/onlyoffice-auto-fix.sh
|
||||
14
etc/systemd/system/onlyoffice-fix.timer
Normal file
14
etc/systemd/system/onlyoffice-fix.timer
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[Unit]
|
||||
Description=Run OnlyOffice auto-fix after Nextcloud AIO backup
|
||||
|
||||
[Timer]
|
||||
# Primary window: every 5 minutes between 04:10–04:40 UTC
|
||||
OnCalendar=*-*-* 04:10:00..04:40:00/5 UTC
|
||||
|
||||
# Safety run: once per hour at minute 10 (UTC)
|
||||
OnCalendar=*-*-* *:10:00 UTC
|
||||
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
30
usr/local/sbin/onlyoffice-auto-fix.sh
Normal file
30
usr/local/sbin/onlyoffice-auto-fix.sh
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
|
||||
LOCK="/tmp/onlyoffice-check.lock"
|
||||
LOG="/var/log/onlyoffice-auto-fix.log"
|
||||
|
||||
if [ -f "$LOCK" ]; then
|
||||
echo "$(date '+%F %T') : lock present, skipping" >> "$LOG"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
touch "$LOCK"
|
||||
|
||||
{
|
||||
echo " "
|
||||
echo "===== $(date '+%F %T') : Running OnlyOffice check ====="
|
||||
|
||||
docker exec nextcloud-aio-nextcloud \
|
||||
sudo -E -u www-data php occ onlyoffice:documentserver --check
|
||||
|
||||
STATUS=$?
|
||||
|
||||
if [ $STATUS -eq 0 ]; then
|
||||
echo "$(date '+%F %T') : OK ✓"
|
||||
else
|
||||
echo "$(date '+%F %T') : ERROR – DocumentServer not ready ❌"
|
||||
fi
|
||||
|
||||
} >> "$LOG" 2>&1
|
||||
|
||||
rm -f "$LOCK"
|
||||
Loading…
Add table
Reference in a new issue