Q&A: Can I Use cron To Run My Own Scripts?

Question: Can I use cron To Run My Own Scripts?

Answer

Yes, this is possible. The easiest way would be to create (symbolic) links to your script file within the related cron directories under /etc:

cron.d
cron.daily
cron.hourly
cron.monthly
crontab
cron.weekly

Option 1

Put a crontab file with the needed schedule information in cron.d:

root@ucs:/etc/cron.d# cat univention-config-registry-backup
[...]

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

30 3     * * *   root            /usr/share/univention-config-registry/univention-config-registry-backup

Option 2

Create your script (or use links) in the daily, hourly, weekly or monthly folders. It will then executed accordingly to the name of the directory. But there will be no exact scheduled time.

Mastodon