• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Manage and modify cron.daily start hour

SalvadorS

Regular Pleskian
Hello,

Now on my Plesk 9.3 servers the everyday awstats proccess ends at 11AM more or less. I want this proccess to ends sooner than that hour.

I know awstats proccess is part of daily proccess execute in plesk every day. These process starts on 50plesk-daily cron which is executed everyday. I know that this command inside 50plesk-daily who manage the update of the daily stats (and more things):

/opt/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/DailyMaintainance/script.php

So, If I delay the start of 50plesk-daily one hour for example, the stats must end one hour before (more or less)

Checking where 50plesk-daily cron is I find this under /etc/crontab:

mercurio:/etc/cron.daily# cat /etc/crontab
# /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 )

So this cron runs /etc/cron.daily.

Questions:

1.- Is this cron running really /etc/cron.daily

2.- I modify crontab for the line:

25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

From 6.25 to 5.25 but the stats ends at the same hour.

What I am doing wrong?

Where I can really modify the cron.daily to start earlier?

Thanks
 
Dear Igor, thanks for your quick reply.

I check it in the two bigger transfer usage domains and we don´t have the issue:

server:/var/www/vhosts/xxx.com/statistics/logs# grep 31/Ago/2010 access_log.processed* | perl -lne 'BEGIN {$max=0} {$curlen = length($_); if($curlen>$max) { print ; $max = $curlen } }' | tail -1

server:/var/www/vhosts/xxx.com/statistics/logs#

server:/var/www/vhosts/xxx.es/statistics/logs# grep 31/Ago/2010 access_log.processed* | perl -lne 'BEGIN {$max=0} {$curlen = length($_); if($curlen>$max) { print ; $max = $curlen } }' | tail -1

server:/var/www/vhosts/xxx.es/statistics/logs#
 
I have following default simple record in /etc/crontab for cron.daily

46 5 * * * root run-parts /etc/cron.daily

Are you sure that you have not modified /etc/crontab ?
 
No I don´t.

This is the crontab (/etc/crontab) for my 9.3 Plesk over Debian:

server:/etc# cat crontab
# /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 5 * * * 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 )
#

And this is another crontab (/etc/crontab) from another server 9.5 plesk over debian:

server:~# cd /etc
server:/etc# cat crontab
# /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 )
#

As you can see is the same content and I think there aren´t two differents crontabs (/etc/crontab). Also we have some VPS with the same crontab file.

Can you post your /etc/crontab in order to know how your file is configured?
 
# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
43 * * * * root run-parts /etc/cron.hourly
46 5 * * * root run-parts /etc/cron.daily
17 2 * * 0 root run-parts /etc/cron.weekly
9 0 18 * * root run-parts /etc/cron.monthly
*/5 * * * * root (cd /usr/local/sitebuilder/utils && /opt/php52/bin/php5 tasksmng.php > /dev/null 2>&1)

# rpm -qf /etc/crontab
crontabs-1.10-8

# cat /etc/redhat-release
CentOS release 5.5 (Final)
 
Hello,

Your release is CentOS release 5.5 (Final), our releases are Debian and Ubuntu. Can we modify the crontab and put the line:

46 5 * * * root run-parts /etc/cron.daily

Instead

25 5 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

Without any trouble?
 
Also helps if anybody with debian can post their /etc/crontab file and if somebody changed the start hour for the cron.daily

Thanks
 
2 options: you could change the crontab and remove the test -x /usr/sbin/anacron or remove anacron itself.

The daily script isn't running at the time you changed in the original crontab, because you probably have anacron installed. Plesk 9 does not support anacron and anacron is not started regularly on a server. Otherwise anacron would have ran the cron.daily. But anacron doesn't get started and therefore it doesn't. And next to that, because it is installed cron doesn't do job either. Guess you run 8.04 right? Believe this issue is solved in Ubuntu 9.

Last option could also be to run anacron through cron.
 
Back
Top