CoreOS

How To Create a Cron Job on CoreOS ?

Creating a Systemd Service on CoreOS

Nowadays, we encounter so much with CoreOS Linux distributions on customer environments.

It is started to become more popular after the Red Hat’s procurement. It is Linux based operating system but there are of course differences between traditional Linux systems and CoreOS.  It is also known as immutable operating system / container operating system.

CoreOS has no package manager and cron utility.  So If you need to cron some of the scripts on CoreOS you will need to use another methods.

How can we enable cron job on CoreOS ?

Only thing that we can do is to configure the systemd services. Also configuring the service depends of your needs. If you need a cron job it runs everytime, such as logging, monitoring, etc then only the below configuration is enough for your needs.

In our case,  there is  a shell script under “/scripts” folder and named as “executedbysystemd.sh”.

To be able to run that service via systemd we are creating a custom systemd service as below.

At this stage we have created the systemd configuration file but we need to enable and start it.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button