Koozali.org: home of the SME Server

Edit crontab

Dennis

Edit crontab
« on: December 01, 2002, 02:59:40 PM »
Hi there,

how do I edit the crontab file?

It says :
/snip
#------------------------------------------------------------
# DO NOT MODIFY THIS FILE! It is updated automatically by the
# e-smith server and gateway software. Instead, modify the source
# template in the /etc/e-smith/templates directory. For more
# information, see http://www.e-smith.org.
#
# copyright (C) 2001 Mitel Networks Corporation
#------------------------------------------------------------
\snip

And when I edit it, it runs great until a curtain time, where the system is updating the files, and the line I’ve added are gone again.


Can anyone point me in the right direction?

/ Dennis

guestHH

Re: Edit crontab
« Reply #1 on: December 01, 2002, 03:26:19 PM »

Jesper

Re: Edit crontab
« Reply #2 on: December 03, 2002, 05:19:43 PM »
Dennis,

The below example inserts the command all-ip in the crontab. You have to create a custom template.


[root@e-smith ]# chmod 755 /etc/mrtg/all-ip

[root@e-smith ]# mkdir -p /etc/e-smith/templates-custom/etc/crontab/

[root@e-smith ]# echo "0-59/5 * * * * root /etc/mrtg/all-ip" > /etc/e-smith/templates-custom/etc/crontab/mrtg

[root@e-smith ]# /sbin/e-smith/expand-template /etc/crontab

Dan Brown

Re: Edit crontab
« Reply #3 on: December 03, 2002, 05:30:48 PM »
Just FYI, this line:

[root@e-smith ]# echo "0-59/5 * * * * root /etc/mrtg/all-ip" > /etc/e-smith/templates-custom/etc/crontab/mrtg

could also be written as:

echo '*/5 * * * * ...