Running a script every night not working

Hi guys Im having a bit of trouble getting a script i have run to work.

Long story short of the scenario…

Im triggering photos everytime someone walks in front of the CCTV camera. All working perfect, and the photos are stored in a folder…which I dont want to fill up.

Ive written a script that uses uses ‘rclone’ to copy the files to my google-drive. When I run the script from terminal it works perfectly… but when I run it via a HA automation (every night at 11.59pm), it fails.

Ive setup some logging, and the part that fails is the rclone command, whch fails with;

/config/scripts/move_snapshots.sh: line 27: /usr/bin/rclone: No such file or director

So after spending a lovely hour with ChatGPT, the summary seems to be that rclone is installed outside the HA environment, and thus cant be found.

Does anyone know the most elegant solution to get the script to run every night…even if i need to do so outside of HA?

Hello David,

Do you have add-ons? If so get it running with a cron here…

yeah I do have the advanced terminal add-on. Ive been using that when writing/testing the script. I tried to add it to cron, but terminal tells me there is no cron running.

I was really hoping to run the command from within HA, rather than in the OS…just feels neater to be able to see whats wrunning/when. Is that not going to be possible?