cron.daily does not work ?

pppplus

Verified User
Joined
Dec 19, 2008
Messages
528
Hi everybody !

It seems my cron.daily do not run every days.

And I have a big problem, logs do not rotate... And files are bigger every days.

So my partition /dev/md1 is 100% full.

How to verify - modify things to restats cron.daily ?
In file /etc/crontab, I have :
Code:
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

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

# m h dom mon dow user	command
17 *	* * *	root    cd / && run-parts --report /etc/cron.hourly
25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6	* * 7	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6	1 * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#


*/1 * * * * root /usr/local/rtm/bin/rtm 55 > /dev/null 2> /dev/null



In cron logs, I have this line :
Code:
Jan  5 06:25:01 ns1 /USR/SBIN/CRON[3156]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))

and for cron.hourly, I have this line
Code:
Jan  5 07:17:02 ns1 /USR/SBIN/CRON[23483]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

And my partitions :
Code:
ns1:~# df -h
Sys. de fich.         Tail. Occ. Disp. %Occ. Monté sur
/dev/md1              9,7G  9,1G   44M 100% /
tmpfs                1005M     0 1005M   0% /lib/init/rw
udev                   10M   44K   10M   1% /dev
tmpfs                1005M     0 1005M   0% /dev/shm
/dev/md2              449G  158G  269G  37% /home

Last thing : I mount virtual partition to read ftp backups, with curlftpfs on /media/backups
I try to unmount virtual partition with command (I find it with google)
fusermount -u /media/backups/
But => fusermount: entry for /media/backups not found in /etc/mtab

The backup files on /media/backups are on /dev/md1/ because when I delete them, /dev/md1/ comes back to 26%

So 3 problems to solve for me

1- log rotate
2- unmount /media/backups
3- mount new folder for baclups, but not in /dev/md1 => so maybe mount folder in /home forlder ?

Thanks for your help
 
for my 2nd problem, it is solved, now virtual partition to read ftp backups is unmount.

Always my big problem with log rotation in cron.daily
 
Yes, clear.

I have some file with rotation, some without.
Why ? I don't know exactly !

For example, files in /var/lob/exim do not rotate.

I have exim file in cron.daily and it seems ok
I have another file in cron.daily (to backup datas in another ftp server) and the scripts do not run.

So I suppose all files in cron.daily do not run. How to test it ?
 
Did you do as scsi said? Did you go to /var/log and check the log for cron? It tells you what ran.

But you might want to check out the logrotate configuration. After all cron does not rotate the logs, logrotate does.
 
/var/log/crond wouldn't show all of the logs that were rotated. Since no OS information was provided I'll assume your running CentOS or some flavor of Linux.

If your files in /var/log/exim are not rotating I would direct your attention to your logrotate.conf file to be sure it is setup right and then /etc/logrotate.d and check to see if there is an exim file in there, if so it should read something like:

/var/log/exim/*log {
missingok
notifempty
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/exim.pid 2>/dev/null` 2> /dev/null || true
endscript
}

Credit for the above script goes to http://www.flatmtn.com/article/setting-exim
 
Thanks for your reply !

In /var/log/cron, I have nothing really helping me !
Code:
Jan 11 06:24:01 ns1 /USR/SBIN/CRON[31349]: (root) CMD (/usr/local/directadmin/dataskq)
Jan 11 06:25:01 ns1 /USR/SBIN/CRON[31412]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
Jan 11 06:25:01 ns1 /USR/SBIN/CRON[31413]: (root) CMD (/usr/local/rtm/bin/rtm 55 > /dev/null 2> /dev/null)


I am on Debian (I post in Debian section, because this server has Debian)

I already check file /etc/logrotate.conf and it seems to be correct. I post it :
Code:
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 3

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

# system-specific logs may be configured here
/var/log/exim {
    missingok
    dayly
    create 0664 root utmp
    rotate 3
}

I also post /etc/logrotate.d/exim
Code:
/var/log/exim/mainlog /var/log/exim/rejectlog /var/log/exim/paniclog {
	daily
	missingok
	rotate 3
	compress
	delaycompress
	notifempty
	create 640 mail mail
}
 
/var/log/crond wouldn't show all of the logs that were rotated.

No but it does show that cron actually ran the jobs it was supposed to run. If cron does not run it then nothing else matters.

Since no OS information was provided I'll assume your running CentOS or some flavor of Linux.

Obviously since DirectAdmin will not run on anything else.

And the /etc/logrotate.d/exim should be the one provided by DirectAdmin

Code:
/var/log/exim/mainlog /var/log/exim/processlog /var/log/exim/rejectlog /var/log/exim/paniclog {
sharedscripts
}
 
Ah, ignore my ignorance about the OS thing :)

Possible permission issue? Try running logrotate manually in debug mode (if it has one). Keep in mind I'm pulling these suggestions out of my butt as I'm too lazy to login to my server :eek:
 
Ok, thanks, I think I find the problem, with debug mode !

logrotate -dv /etc/logrotate.conf

Give me some errors. The problem was :

/etc/logrotate.conf includes /etc/logrotate.d

And in folder /etc/logrotate.d, there is another logrotate.conf, including also /etc/logrotate.d.

I comment all line of /etc/logrotate.d/logrotate.conf

Thanks for your help, even if I do not understand all (specially FreeBD and Centos ...) :)

I test now without debug mode, and ... it works ! Perfect !!! :cool:
 
Ok, the automatic logrotate works perfect ! Thanks for your help.

Only one small problem left :

I put a small program in cron.daily folder, and I understand it would be automatically launch. But it do not start with cron.daily.

On another server with Centos, it works perfectly. I probably miss something...
 
Back
Top