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!

wget cron does not work as username

Discussion in 'General Discussion' started by icandoit, Dec 2, 2015.

  1. icandoit

    icandoit Well-Known Member

    Joined:
    Dec 21, 2010
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    56
    as cpanel user name I noticed my cron job that has wget in it does not work
    but I put the same cron in the main crontab root and it works

    Any Idea?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Eric

    Eric Administrator
    Staff Member

    Joined:
    Nov 25, 2007
    Messages:
    751
    Likes Received:
    11
    Trophy Points:
    143
    Location:
    Texas
    cPanel Access Level:
    Root Administrator
    Could we get a peak at crontab -l for the user?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. icandoit

    icandoit Well-Known Member

    Joined:
    Dec 21, 2010
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    56
    Please speak English :-D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. icandoit

    icandoit Well-Known Member

    Joined:
    Dec 21, 2010
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    56
    I did not understand do you want the contents of cron? it has never changed for the last 5 years , I was in centos 5 recently moved to centos 6 and the same cron works if I put it in main cron but not as user
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Are you using Cloud Linux with CageFS enabled? The command suggested in the previous post may help us troubleshoot the issue:

    Code:
    crontab -l
    Run this command while logged in as the account username via SSH.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. icandoit

    icandoit Well-Known Member

    Joined:
    Dec 21, 2010
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    56
    I do not use cloudlinux or the other one

    Here we go


    user@domain.com [~]# crontab -l
    SHELL="/usr/local/cpanel/bin/jailshell"
    0 13,20 * * * /bin/sh /home/user/backups/backup1.sh
    45 7 15 * * /bin/sh /home/user/backups/backup2.sh
    */4 * * * * wget -O /dev/null --no-check-certificate https://www.mydomain.com/help/crons/index.php?/Jor/Par/POP3IMAP


    Only the last cron does not work and I tried other wget they did not work either
    but I use it in main crontab as root every thing works
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Can you run the command successfully when logged in as the account username via SSH? What are the permissions and ownership values on the /usr/bin/wget file?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. icandoit

    icandoit Well-Known Member

    Joined:
    Dec 21, 2010
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    56
    Hi
    Thanks for your reply. The permission is 700 and the ownership is root
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    The default permissions for /usr/bin/wget are 0755. Does updating the permissions on this file to 0755 make a difference?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. icandoit

    icandoit Well-Known Member

    Joined:
    Dec 21, 2010
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    56
    Thanks such a simple issue. Resolved but what I do not understand in a brand new server and installation what possibly changed that permission to 700? I use csf and I was making some changes as suggested in csf however not sure any of the changes I made could possibly affect the wget permission .
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    It's possibly a default permission depending on your operating system environment and any security settings/applications (e.g. SELinux) you have configured.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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