Script error help

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

Welcome to the forum @Joao

You can test script identicality with other server using something like sha1sum.

Make sure file is executable. For example, use ls -l and chmod it if needed.

Check for potentially invisible issues such as it being saved in Windows format.
If that’s done, the extra carriage return after bash will make it impossible to find.
od -c on the file is one way to show the line endings. Use hexdump if you like.

Alternatively, manually create a script to do something simple like echo to a file.
If that works, then it shows scripts work. You can continue looking into the other.