Simple shell script returns Error 1

Hey guys,

I have two shell commands in my environment. The first one runs perfectly, but the second one isn’t. I receive an error message:

Error running command: `/bin/bash /config/cfg/script/delete_old_backups.sh`, return code: 1

This is the content of shell_commands and the script itself.

### shell_commands ### 
delete_old_backups: 'bash /config/cfg/script/delete_old_backups.sh'


### delete_old_backups.sh script ###

#!/bin/bash

find /backup/* -mtime +3 -exec rm {} \;

Full error message:

Error running command: `bash /config/cfg/script/delete_old_backups.sh`, return code: 1
7:47 AM /usr/lib/python3.6/site-packages/homeassistant/components/shell_command.py (ERROR)

I’ve checked the forum and there’s a number of issues with shell commands under HASSIO, but the first script is very similar in the way it’s called but executes fine.

I’m sure it’s something simple I’m missing but really could use some guidance.

Cheers!

Same issue here, with exactly the same bash command.

Did you found the solution to this?

Nope, just a very extensive work around. Because I was running on a Raspberry and wanted to play around with Nodered I’ve upgraded to an Intel NUC and I’m running home assistant in a docker container. Backups are available to the host and I’m copying those externally for a secondary backup.

Delete old backups shell command error I wrote a custom_service that you can write an automation against.

did you ever figure it out? i also have error 1

when i do the same command from a SSH , then it works

I have the same problem
RPi 4 4GB
Home Assistant 2021.2.3