My hassio build is down atm as Iām moving over to a small desktop ubuntu machine so I canāt test it. There must be a way to add the permissions needed by rm, but I donāt know them
The trouble with that is SSH might work in a different container to HA, as evidenced by the previous commands working via SSH but not as shell_commands.
but the āfindā command should be installed in the same directory regardless. There shouldnāt be two of them on the same server. What Iām thinking is that āfindā isnāt being found in whatever environment you have when your shell command is run. You may have said this earlier, is this being run as a cron job or some other scheduler.
Which is the approach Iām using. I think the issue as I said is the docker container running the command_line in yaml is different to the ssh container and those files just arenāt available in the command_line container.
I created a batch file and run it nightly as a scheduled task. Below is the contents of the batch file. I use pushd and popd to avoid having to map a drive letter. To avoid having the DOS box appear when the scheduled job runs be sure and select āRun whether user is logged on or notā on the General tab when you setup the scheduled task.
@echo off
pushd \\hassio\backup
forfiles /M *.tar /D -15 /C "cmd /c del @file"
popd