I have this same question.
Running your podman container on a schedule using cron or a systemd timer is an acceptable solution as long as you have access to the host where your container is installed. If the container is on a Kubernetes platform where you don't actually have access to a host and the host where the container is running may change each time the container runs, you will need to use a Kubernetes CronJob YML.
Seems the solution is as follows:
If you have access to the host, schedule your container or pod start using a systemd timer and service.
Here is an example test-container.service:
[Unit]
Description=TestContainer
Requires=podman.service
After=podman.service
[Service]
Restart=always
ExecStart=/usr/bin/podman run test-container
[Install]
WantedBy=multi-user.target
And test-container.timer which will run every 5 minutes
[Unit]
Description=Test Container Timer
[Timer]
OnCalendar=*:00/5:00
Unit=test-container.service
[Install]
WantedBy=timers.target
Now if you are on Kubernetes cluster you can schedule this using a Kubernetes CronJob YML file like the following which will also start the container every 5 minutes:
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: test-container-schedule
spec:
schedule: "0 0/5 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: test-container
image: test-container-image
restartPolicy: OnFailure
The only other thing to consider is that you want to configure your container to exit after it has executed and performed it's function, otherwise the container start command will fail because the container is already running.