Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

user cron job not appearing on server /var/log/cron

Discussion in 'General Discussion' started by Havri, Nov 1, 2017.

  1. Havri

    Havri Well-Known Member

    Joined:
    Oct 28, 2013
    Messages:
    81
    Likes Received:
    17
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hello,

    I was trying to debug some cron script for some users but when I tried to look in /var/log/cron, I didn't find any entries for any users. I can see all the entries for the root user, but not for anybody else:

    Code:
    Nov  1 15:21:01 ssd01 CROND[907489]: (root) CMD (/usr/share/optimumcache/perf_log.py --append)
    Nov  1 15:21:01 ssd01 CROND[907490]: (root) CMD (/usr/bin/jetcli backup -R snapshots > /dev/null 2>&1)
    Nov  1 15:21:01 ssd01 CROND[907492]: (root) CMD (/usr/bin/jetcli backup -R clone > /dev/null 2>&1)
    Nov  1 15:21:01 ssd01 CROND[907499]: (root) CMD (/usr/share/optimumcache/optimumcache_purge 2>/dev/null)
    Nov  1 15:21:01 ssd01 CROND[907494]: (root) CMD (/usr/bin/jetcli backup -R clearcache > /dev/null 2>&1)
    Nov  1 15:21:01 ssd01 CROND[907497]: (root) CMD (/usr/bin/jetcli backup -R restore > /dev/null 2>&1)
    Nov  1 15:21:01 ssd01 CROND[907498]: (root) CMD (/usr/bin/jetcli backup -R downloads > /dev/null 2>&1)
    Nov  1 15:22:01 ssd01 CROND[908348]: (root) CMD (/usr/share/optimumcache/perf_log.py --append)
    Nov  1 15:22:01 ssd01 CROND[908350]: (root) CMD (/usr/bin/jetcli backup -R clone > /dev/null 2>&1)
    Nov  1 15:22:01 ssd01 CROND[908354]: (root) CMD (/usr/bin/jetcli backup -R clearcache > /dev/null 2>&1)
    Nov  1 15:22:01 ssd01 CROND[908359]: (root) CMD (/usr/share/optimumcache/optimumcache_purge 2>/dev/null)
    Nov  1 15:22:01 ssd01 CROND[908376]: (root) CMD (/usr/bin/jetcli backup -R restore > /dev/null 2>&1)
    Nov  1 15:22:01 ssd01 CROND[908377]: (root) CMD (/usr/bin/jetcli backup -R snapshots > /dev/null 2>&1)
    Nov  1 15:22:01 ssd01 CROND[908399]: (root) CMD (/usr/bin/jetcli backup -R downloads > /dev/null 2>&1)

    I am running CentOS 6.9, Cloudlinux + CageFS + PHP Selector, but I also have to mention that this problem is also on CentOS 7.X. I also tried restarting the crond service, but there was no change.

    From what I know, all users' crons should be logged in the system's cron log in /var/log/cron. Was there some change along the way or is there some settings that I should change?

    Thank you.
     
  2. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    257
    Likes Received:
    29
    Trophy Points:
    103
    Location:
    America
    cPanel Access Level:
    Root Administrator
    Hi,

    Would you happen to be running CSF(Config Server Security & Firewall)? If so, please check the 'RESTRICT_SYSLOG' directive at `/etc/csf/csf.conf'. If not, can you confirm the cron jobs are actually being executed for the users? You could do a simple test like '* * * * * date >> log' to confirm.

    Thanks,
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,762
    Likes Received:
    116
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    This is because end user crontab tasks are executed within a jailshell. The jailshell does not have privileges to write to /var/log/cron. This has been an issue ever since crontab tasks started being executed in jailshell, which was many, many versions ago.
     
  4. Havri

    Havri Well-Known Member

    Joined:
    Oct 28, 2013
    Messages:
    81
    Likes Received:
    17
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, the cronjobs are running correctly. I know this is a pretty old problem, but I thought I could make it work again with some sort of cPanel/CageFS/CSF artifice. Would be useful to have this logged.

    I currently have RESTRICT_SYSLOG = "0", so there shouldn't be a problem, but it still doesn't write anything. If you can give me a few pointers, I would appreciate it.

    Thank you.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice