Cron job on a specific app

Before going to electric eel, I was on dragonfish and I set up a cron job for my photoprism to index nightly. This cron job worked perfectly.

k3s kubectl exec -n ix-photoprism k3s kubectl -n ix-photoprism get pod -o name --field-selector=status.phase==Running – photoprism index --cleanup

Now, this cron job command no longer works in electric eel. When I tried it as root in shell, it says:

zsh: command not found: k3s

I suppose it’s because the upgrade has moved to real dockers.
So I tried this command:

docker exec -ti $(docker ps -aqf “name=photoprism”) photoprism index -cleanup

It still does not work as cron job.

It does work in shell though. Anything I missed?

The i in -ti stands for “interactive”

Maybe you don’t need to specify teletype/tty (t), aka a terminal, or interactive (i) in the docker command.

I tried removing the -ti in the cron job and still it does not work:

docker exec $(docker ps -aqf “name=photoprism”) photoprism index -cleanup