Date: Tue, 29 Feb 2000 07:11:50 -0500 (EST) From: John Baldwin <jhb@FreeBSD.org> To: Ertan Kucukoglu <ertank@ozlerplastik.com> Cc: questions@FreeBSD.org Subject: Re: crontab entries Message-ID: <200002291211.HAA02326@server.baldwin.cx> In-Reply-To: <38BB75A2.CAB9FC4B@ozlerplastik.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 29-Feb-00 Ertan Kucukoglu wrote: > John Baldwin wrote: >> >> On 28-Feb-00 Ertan Kucukoglu wrote: >> > Hello, >> > >> > I have problems with periodic command in crontab file. >> > --- >> ># do daily/weekly/monthly maintenance >> > 59 1 * * * root periodic daily 2>&1 | sendmail root >> > 30 3 * * 6 root periodic weekly 2>&1 | sendmail root >> > 30 5 1 * * root periodic monthly 2>&1 | sendmail root >> > --- >> > >> > I see the man page of periodic command. It says 'periodic runs the >> > executable scripts and files in the specified directory.' The default >> > directory is /etc/periodic. >> > >> > I have cron jobs setup to run between Monday and Saturday but not >> > Sunday. This periodic command runs my scripts every day although I >> > didn't put my scripts anywhere in /etc/periodic/ >> >> Where did you put your scripts? It also runs scripts in >> /usr/local/etc/periodic and I think /usr/X11R6/etc/periodic. Also, what >> do the entries in crontab for your other cron jobs look like? >> > I don't have the directories you mentioned above: > -- > bash-2.03# ls -l /usr/local/etc/periodic > ls: /usr/local/etc/periodic: No such file or directory > bash-2.03# ls -l /usr/X11R6/etc/periodic > ls: /usr/X11R6/etc/periodic: No such file or directory > bash-2.03# > -- > > Here are my complete /etc/crontab file: ># /etc/crontab - root's crontab for FreeBSD ># ># $FreeBSD: src/etc/crontab,v 1.18.2.2 1999/08/29 14:18:39 peter Exp $ ># > SHELL=/bin/sh > PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin > HOME=/var/log > MAILTO=admin ># >#minute hour mday month wday who command ># > */5 * * * * root /usr/libexec/atrun ># ># rotate log files every hour, if necessary > 0 * * * * root newsyslog ># ># do daily/weekly/monthly maintenance >#59 1 * * * root periodic daily 2>&1 | sendmail $MAILTO >#30 3 * * 6 root periodic weekly 2>&1 | sendmail $MAILTO >#30 5 1 * * root periodic monthly 2>&1 | sendmail $MAILTO ># ># time zone change adjustment for wall cmos clock, ># does nothing, if you have UTC cmos clock. ># See adjkerntz(8) for details. > 1,31 0-5 * * * root adjkerntz -a ># ># BNC IRC proxy >#0,10,20,30,40,50 * * * * /home/bnc/bncchk >/dev/null 2>&1 > 0,10,20,30,40,50 * * * * ertan /home/bnc/bncchk ># ># Otomatik faks tasima ># > * * * * * root /bin/move_faxes >/dev/null 2>&1 ># ># Hafta ici sabahlari otomatik internete baglan > 30 7 * * 1-6 root echo "ppp calistiriliyor..." > 30 7 * * 1-6 root /usr/sbin/ppp -alias -ddial isp ># ># internete baglandiktan 15 dakika sonra mailleri almaya basla > 45 7 * * 1-6 root echo "fetchmail calistiriliyor..." > 45 7 * * 1-6 root /usr/local/bin/fetchmail -L /fm.log -f > /.fetchmailrc ># ># Aksamlari mail loglarini tasi ># >#Once fetchmail'i kapat > 45 23 * * 1-6 root /bin/ps ax > 45 23 * * 1-6 root /usr/local/bin/fetchmail -q > 46 23 * * 1-6 root /bin/ps ax >#Sonra log dosyasini tasi > 50 23 * * 1-6 root /bin/mv_fmlog >#En son squid log dosyalarini tasi > 55 23 * * 1-6 root /bin/mv_squid_log > bash-2.03# > > My scripts are located under /bin mostly. I don't change the $PATH > environment in my scripts. I have only one command line that is > fetchmail. > > My those scripts are run from Monday to Sunday. I do not see any echo > mails on sunday but my box connects to the internet sundays at 1:59. > This time is the same time with daily perodic cron job and I have no > other job setup at that time. I also don't have any user cron jobs: > -- > bash-2.03# ls -la /var/cron/tabs/ > total 2 > drwx------ 2 root wheel 512 Sep 17 01:36 . > drwxr-x--- 3 root wheel 512 Feb 29 07:00 .. > bash-2.03# > -- > > I don't know which path is given to periodic jobs in crontab (I couldn't > understand). The command 'periodic daily' runs all the scripts in /etc/periodic/daily, /usr/local/etc/periodic/daily (if it exists), and /usr/X11R6/etc/periodic/daily (if it exists). Ok, now you said: >> > I have cron jobs setup to run between Monday and Saturday but not >> > Sunday. This periodic command runs my scripts every day although I >> > didn't put my scripts anywhere in /etc/periodic/ Alright, your crontab looks fine. However, my question is: how do you know that periodic is running your scripts on Sunday? You said that your modem dials out at 1:59 on Sunday, well, that is probably due to one of the weekly scripts in /etc/periodic/weekly/ needing net access for some reason, or perhaps a one of the daily scripts in /etc/periodic/daily/ needing net access. > Regards, > > -- > Ertan Kucukoglu > ertank@ozlerplastik.com -- John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002291211.HAA02326>