Hello, I have a small script that I’m trying to run before starting a backup.
2025-11-09 23:31:56 +00 - [Warning-Duplicati.Library.Modules.Builtin.RunScript-ScriptExecuteError]: Error while executing script "/config/scripts/stopperI.sh": An error occurred trying to start process '/config/scripts/stopperI.sh' with working directory '/app/duplicati'. Exec format error Win32Exception: An error occurred trying to start process '/config/scripts/stopperI.sh' with working directory '/app/duplicati'. Exec format error
The script is exactly the same has the script in another server mirroring mine, but for some reason is not running on my server.
#!/bin/bash
echo $CONTAINERSI#get env variable CONTAINERS (Add environment variable CONTAINERS to your compose file)
#Example: CONTAINERS=container1,container2,....
# Split the string into an array using ','as the delimiter
IFS=',' read -r -aCONTAINER_ARRAY <<<"$CONTAINERSI"
# Loop through each container name and start it
for CONTAINER in "${CONTAINER_ARRAY[@]}"; do
docker container start"$CONTAINER"
if [$?-eq 0 ]; then
echo "Started $CONTAINER successfully."
else
echo "Failed to start $CONTAINER."
fi
done
exit 0
The script runs well in the command line.my server runs ubuntu server, in docker. this is my compose services:
duplicati:
image: lscr.io/linuxserver/duplicati:latest
container_name: duplicati
restart: unless-stopped
env_file:
- .env
volumes:
- /home/user/system/dcompose/duplicati/config:/config
- /home/user/system/dcompose:/source/dcompose
- /home/user/backup:/backups
- /seafile:/source/seafile
- /immich:/source/immich
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
ports:
- 8200:8200
environment variables are correctly declared