Ont (short for ontime) is a cronjob-like command line tool featuring simpler commands and more robust job management. With ont, you can store jobs in a database, stop them, and restart them at any time.
This project is in the beta phase, and using it in production environments is not recommended at the moment. However, we would appreciate it if you could test it and provide feedback.
- Easier syntax. You just need to pass the correct value to the option, pass the script path, and press enter.
- It is a matter of just one command line which can be executed from anywhere on the cluster to submit a job.
- You can easily stop the job and start it again anytime later.
- You can check the status of the last execution of a job (in progress).
- You can run a job on a remote server and manage all the jobs from one single node and from any node connected to ontd in the cluster.
- Easy to manage and debug.
Note: The admin need to be either root user or sudo user.
- Install ont on a server (check the installation guide).
- Run the script initOnt.sh to create the DB, choose the DB password, and initialze ontd.
$ wget <script path>
$ chmod +x init_ont.sh
$ ./initOnt.sh
- Modify the default values in the file
/etc/ont/ont.confas per the environment requirements. - Start the ont daemon as follows:
$ ont daemon
The ont daemon can also be started using systemd:
$ systemctl status ontd.service
If the file ontd.service doesn't exist, please create it and start the service. You can find a sample in ontd.service file.
- To test the installation you can check the version and the help function.
$ ont -v
$ ont -h
Using ont as a user is pretty simple, you just need to run one of the subcommands and pass the arguments.
-
To submit a job:
$ ont run --every 1d --from now /path/to/script.shThis will execute the script
script.shevery day (1d) starting from now (now). Usingnowwill execute the job immediately once, and then the next execution will be the following day at the same time. You can also pass a specific time or date. More examples can be found in the help output of the command.$ ont run -h -
To list all the jobs:
$ ont list -
To start/stop/remove a job. You can use one of the subcommands
start,stop,removeand pass the jobid.$ ont start <jobID>You can also run a job on a remote server by passing the name or the IP address of the remote server to the
runsubcommand.$ ont run -e 1d -f now -n node001 /path/to/script.shThis will execute the script
script.shon the nodenode001every day starting from now.
- Install the binary as follows:
$ go install -v github.com/ontime-dev/ont@latest
- Download the initOnt.sh script:
$ wget https://raw.githubusercontent.com/ontime-dev/ont/main/scripts/initOnt.sh
- Set the script as executable:
$ chmod +x initOnt.sh
- Execute it to setup ont:
$ ./initOnt.sh
That's it, ont is installed now. You can modify the configuration parameters in ont.conf as required, and then start the daemon:
$ <path/to/ont> daemon
You can also create a ontd.service file and enable it using systemctl:
$ systemctl enable --now ontd.service
