t0mi
Members
-
Joined
-
Last visited
Solutions
-
t0mi's post in Unraid 7.1.4 update wiped entire ZFS pool with appdata (mostly databases) – any recovery options? was marked as the answerokay after investigation i found out i pointed the mariadb config and data folders to /mnt/nvme and not /mnt/nvmepool so files were written in RAM, yeah i never rebootet... after update all gone... this was a stupid mistake because the backup script only backup'd the normal /mnt/user/appdata and /mnt/nvmepool/appdata
-
t0mi's post in user for docker container restarts was marked as the answerHello, i searched for the exact same (im running a gameserver docker for my friends and sometimes the server have to be restarted)
Im also hosting nextcloud so i created a user for them where if they need to restart they just create the file restart.txt
the script:
#!/bin/bash # Name of the Docker container CONTAINER_NAME="CoreKeeper" # Path to the watch file RESTART_FILE="/mnt/nvmepool/appdata/nextcloud/data/corekeeper/files/restart.txt" # Infinite loop to check for the file while true; do if [ -f "$RESTART_FILE" ]; then echo "File $RESTART_FILE found. Restarting the Docker container..." # Restart the Docker container docker restart $CONTAINER_NAME # Delete the file to reset the process rm -f "$RESTART_FILE" echo "Docker container has been restarted and the file has been deleted." fi # Wait for 60 seconds before checking again sleep 60 done
UPDATE: do it as userscript in settings and forget that below
In Unraid you open the console and create the restartdockercontainer.sh
Create new file and paste the code inside
nano restartdockercontainer.sh
CTRL+X and save it with Y
use following command so the script can be executed
chmod +x restartdockercontainer.sh
you then can run it with
nohup ./restartdockercontainer.sh &
if you restart your unraid maschine u would need to start it again,
you can check if it is running with command
ps
and kill it with
kill <id>