LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   How to add a crontab job in Debian Linux (https://www.linuxquestions.org/questions/linux-distributions-5/how-to-add-a-crontab-job-in-debian-linux-685790/)

LotharIrausquin 11-24-2008 01:45 PM

How to add a crontab job in Debian Linux
 
Dear Linux Support,

We are using CensorNet (Proxy Server)software on Debian Linux.


This program is using two important daemons namely the squid daemon "/usr/local/squid/sbin/squid"
and dansguardian daemon "/usr/local/sbin/dansguardian".

Because these daemons tend to stop from time to time I need to configure the daemons to start every hour .

I need to edit the /etc/crontab file.

I am not sure if I need to put the "restart" command after the daemon.

If I am correct the crontab should look like something this:

min hr dmon mon wday user command
0 * * * * root /usr/local/squid/sbin/squid
0 * * * * root /usr/local/sbin/dansguardian


Do I have to put the "restart" (or "start" ) command after the daemon? Or can I leave it like this?

anomie 11-24-2008 01:55 PM

Before going down this path, why are the daemons stopping? The fix is not to restart them every hour, but rather to identify and solve that problem.

LotharIrausquin 11-25-2008 06:09 AM

We have no idea why the services stop.
We patched CensorNet with the latest patches.
There is enough diskspace on the Debian Server.
The Debian Server is only used as Proxy Server and nothing else.
So its a dedicated Proxy Server.
The problem is random.

Sometime its run's OK for days than all of a sudden the Debian Server needs to be restarted because the suid and/or danguardian services have stopped suddenly.

It is anoying the users on the network.

I already figured out that the services /etc/init.d/squid and /etc/init.d/dansguardian are the ones that need to be restarted.

So the crontab should look something like this.

min hr dmon mon wday user command
0 * * * * root /etc/init.d/squid restart
0 * * * * root /etc/init.d/dansguardian restart

I log in as root on the Debian Server and edit the crontab by typing "crontab -e".

Question is : Do I have to specify the "root" user account or can I leave that out?


Let me know.

Lothar


All times are GMT -5. The time now is 07:13 PM.