Domino on Linux/Unix, Troubleshooting, Best Practices, Tips and more ...

 
alt

Daniel Nashed

 

Linux - Using Cron to schedule periodic jobs like certificate updates

Daniel Nashed  10 April 2024 09:38:27

In all the years I have never looked into cron.
But it is really a very straightforward functionality, which is used by Linux itself.


You can either schedule user specific jobs or use /etc/cron.d files or /etc/crontab.


There is a certificate update script  -->
https://github.com/HCL-TECH-SOFTWARE/domino-cert-manager/blob/main/examples/nginx/cert_upd_nginx.sh

I did not automate it end to end yet.


A quick look into /etc/crontab shows how it works.


I also added Certificate URL Health on certstore.nsf on top.

But this should automatically pull updated certs from certstore.nsf daily and update the NGINX config.


-- Daniel



SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root


# For details see man 4 crontabs


# Example of job definition:

# .---------------- minute (0 - 59)

# |  .------------- hour (0 - 23)

# |  |  .---------- day of month (1 - 31)

# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...

# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat

# |  |  |  |  |

# *  *  *  *  * user-name  command to be executed


07 07 * * * nginx /local/nginx/cert-update-dnug-lab.sh >> /local/nginx/cert-update.log 2>&1


Comments

1Massimo Nadalin  11.04.2024 6:44:37  Linux - Using Cron to schedule periodic jobs like certificate updates

Hi Daniel!

There's also a third way: using the crontab command to edit user's crontab by typing crontab -e -u nginx

2Daniel Nashed  11.04.2024 20:06:13  Linux - Using Cron to schedule periodic jobs like certificate updates

@Massimo, yes thanks. There are always more ways to do it.

But I want a central location to see all jobs and the main contab allows you to schedule jobs for all users.

-- Daniel

Links

    Archives


    • [HCL Domino]
    • [Domino on Linux]
    • [Nash!Com]
    • [Daniel Nashed]