Koozali.org: home of the SME Server

Obsolete Releases => SME Server 9.x => Topic started by: robf355 on March 13, 2020, 06:56:16 PM

Title: adding to cron.daily
Post by: robf355 on March 13, 2020, 06:56:16 PM
Hi
I'm using openvpn and have to copy over the certifcates every 30 days to the openvpn routed directory using the script below
updatecert.sh

Code: [Select]
#! /bin/sh
# updatecert.sh
# update openvpn routed certificates
#
/cp -af /etc/openvpn/bridge/{priv,pub} /etc/openvpn/routed/
exit 0

Can I the above bash script to cron.daily or do I need to modify the templates?
Thanks
Rob Carter
Title: Re: adding to cron.daily
Post by: TerryF on March 13, 2020, 10:40:03 PM
I think templating is always the preferred method https://wiki.contribs.org/Cron_entry
Title: Re: adding to cron.daily
Post by: ReetP on March 14, 2020, 10:18:01 AM
I think you can just drop that in there.

You only need to template if it is a specific file you are hacking eg adding to /etc/crontab

Title: Re: adding to cron.daily
Post by: robf355 on March 14, 2020, 06:08:47 PM
Thanks for the replies and help
Title: Re: adding to cron.daily
Post by: Jean-Philippe Pialasse on March 15, 2020, 01:41:28 AM
if you put in cron.daily you will have to remember it is there when backup restoring to sme10.

if it is templated in template-custom of crontab you can forget about it

otherwise both are valid.