mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-09-29 10:04:43 +08:00
some small improvements
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
340f7450ca
commit
947be33fcf
2 changed files with 10 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
restart_process() {
|
restart_process() {
|
||||||
echo "Restarting cron.sh because daily backup time was set or unset."
|
echo "Restarting cron.sh because daily backup time was set, changed or unset."
|
||||||
pkill cron.sh
|
pkill cron.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,8 +9,13 @@ file_present() {
|
||||||
if [ -f "/mnt/docker-aio-config/data/daily_backup_time" ]; then
|
if [ -f "/mnt/docker-aio-config/data/daily_backup_time" ]; then
|
||||||
if [ "$FILE_PRESENT" = 0 ]; then
|
if [ "$FILE_PRESENT" = 0 ]; then
|
||||||
restart_process
|
restart_process
|
||||||
|
else
|
||||||
|
if [ -n "$BACKUP_TIME" ] && [ "$(cat "/mnt/docker-aio-config/data/daily_backup_time")" != "$BACKUP_TIME" ]; then
|
||||||
|
restart_process
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
FILE_PRESENT=1
|
FILE_PRESENT=1
|
||||||
|
BACKUP_TIME="$(cat "/mnt/docker-aio-config/data/daily_backup_time")"
|
||||||
else
|
else
|
||||||
if [ "$FILE_PRESENT" = 1 ]; then
|
if [ "$FILE_PRESENT" = 1 ]; then
|
||||||
restart_process
|
restart_process
|
||||||
|
|
|
@ -28,7 +28,10 @@ while true; do
|
||||||
echo "Daily backup has started"
|
echo "Daily backup has started"
|
||||||
|
|
||||||
# Delete all active sessions and create a lock file
|
# Delete all active sessions and create a lock file
|
||||||
rm -f "/mnt/docker-aio-config/session/"*
|
# But don't kick out the user if the mastercontainer was just updated since we block the interface either way with the lock file
|
||||||
|
if [ "$LOCK_FILE_PRESENT" = 0 ]; then
|
||||||
|
rm -f "/mnt/docker-aio-config/session/"*
|
||||||
|
fi
|
||||||
sudo -u www-data touch "/mnt/docker-aio-config/data/daily_backup_running"
|
sudo -u www-data touch "/mnt/docker-aio-config/data/daily_backup_running"
|
||||||
|
|
||||||
# Check if apache is running/stopped, watchtower is stopped and backupcontainer is stopped
|
# Check if apache is running/stopped, watchtower is stopped and backupcontainer is stopped
|
||||||
|
|
Loading…
Add table
Reference in a new issue