How to automate scripts in docker

i have a script to move devices so i would like to automate(like cron ) the script in docker so that i can run the script for every 2 hrs

The usual advice I’ve seen is to run cron on the host.

Running cron in a container can be tricky. It breaks the usual recommendation to run just the process of interest in a container. If the action the script needs to take involves taking actions on other containers, you in effect need to give your one container unrestricted root access to the host. I’m not totally sure what your specific goal is, but anything that involves “moving devices” sounds a little more like it’s a host concern than a Docker concern; most containers aren’t really aware of devices in a normal Linux sense.