[Error] run-script-after "No such file or directory"

Hello all,

I come back to you because I now try to run a script after each backup that allows me to send notifications to my Gotify server to notify me of the success or failure of the backups.

Only, I have an error that tells me that Duplicati can’t find the files I asked him to run, I show you my installation:

In my compose, the config folder is indicated as follows:

volumes:
  - /home/docker/duplicati/config:/config

I put my script “gotify.sh” inside the config folder

In the settings add to my backup, I indicate the path as follows:

I have made the script executable with a chmod a+x, and at the level of rights it belongs to my user that I indicate in the compose 1000:100.

once the script is run I get this error:

I have the impression that he cannot find the file. sh that I ask, probably a path problem but I don’t understand which because /config/gotify.sh should be the right one.

Thank you for your help :pray:

Not sure exactly what goes wrong.
Can you enter the container and run the script from inside the container with no issues?

You have touched an interesting point, I had errors when i launch the script, infact originally I had created it on my windows client with my notepad, then I put it in my /config folder with my smb share, and I made it executable in CLI.

I deleted it, then created and edited everything in CLI with nano, and now it works perfectly!

Thanks for your help I managed to solve the problem with your track!

1 Like

Does the first line of that script start with something like #!/bin/bash?

Windows will end that line with CR NL. Linux will try to run bash<CR >.

bash: ./shebang.sh: /bin/bash^M: bad interpreter: No such file or directory

but if this is what happened, you never got to see the specifics of issue.

yes the script start with “#! /bin/bash”

There was probably a misinterpretation by Linux because of having created it on windows with Notepad++, next time I would do it directly with nano, I have to remove this bad habit from the graphic with windows, it only brings me problems :sweat_smile: