The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Resolved] Automated backups not working correctly via cron (Linux-VServer)

Discussion in 'General Discussion' started by Daniel15, Sep 7, 2010.

  1. Daniel15

    Daniel15 Well-Known Member

    Joined:
    Oct 7, 2006
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Since about a month ago, the automated cPanel/WHM backups haven't been working correctly. They used to work perfectly, but suddenly stopped working one day. My set up is as follows:
    Backup interval = Weekly
    Backup retention = Weekly and Monthly
    Days to run backup = Wednesday
    Backup type = Remote FTP

    In the "Configure cPanel Cron Times" plugin I have cpbackup set to run every day at midnight. If I run /scripts/cpbackup manually, it works and I get an email about the backup being successful. The only log file in /usr/local/cpanel/logs/cpbackup is the log from when I ran the backup manually.

    Any ideas on how to diagnose this issue?
     
    #1 Daniel15, Sep 7, 2010
    Last edited: Sep 8, 2010
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    In Configure cPanel Cron, what do you have for cpbackup exactly?

    Could it be wrong there?
     
  3. Daniel15

    Daniel15 Well-Known Member

    Joined:
    Oct 7, 2006
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    It's configured like this:
    [​IMG]
     
  4. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    To more accurately diagnose the situation it will help to know some additional detail. Please let us know the output of the following commands, as entered via root SSH access:
    Code:
    # grep -H '' /usr/local/cpanel/version /var/cpanel/envtype
    # cat /etc/cpbackup.conf
     
  5. Daniel15

    Daniel15 Well-Known Member

    Joined:
    Oct 7, 2006
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Thanks for your reply, cPanelDon. Here's the output of those commands:
     
    #5 Daniel15, Sep 7, 2010
    Last edited: Sep 7, 2010
  6. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    The cpbackup configuration appears normal; according to your configuration I believe that cpbackup should run each Wednesday assuming there is nothing that may interfere.

    Please use the following command to see if cpbackup is being executed by cron; there should be log entries that mention /scripts/cpbackup:
    Code:
    # zgrep cpbackup /var/log/cron*
    The following command will confirm the crontab entry that is setup, similar to what was seen in WebHost Manager via the Cron Config plug-in:
    Code:
    # crontab -l -u root | grep cpbackup
     
  7. Daniel15

    Daniel15 Well-Known Member

    Joined:
    Oct 7, 2006
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    It stopped working at the end of July, and there's no records for the cronjob since then.
     
  8. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Is the cron daemon running and set to automatically start?
    Code:
    # /etc/init.d/crond status
    # chkconfig --list crond
     
  9. Daniel15

    Daniel15 Well-Known Member

    Joined:
    Oct 7, 2006
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Yes:
    Code:
    root@quimby [/]# /etc/init.d/crond status
    crond (pid  2030) is running...
    root@quimby [/]# chkconfig --list crond
    crond           0: off   1: off   2: on    3: on    4: on    5: on    6: off
    
    I did notice the following in /var/log/cron, which is a bit odd:
    Code:
    2010-09-08T16:00:01.424856+10:00 quimby crond[12575]: Cannot make/remove an entry for the specified session
    2010-09-08T16:00:01.424995+10:00 quimby crond[12575]: CRON (root) ERROR: failed to open PAM security session: Success
    2010-09-08T16:00:01.425004+10:00 quimby crond[12575]: CRON (root) ERROR: cannot set security context
    2010-09-08T16:01:01.427069+10:00 quimby crond[14658]: Cannot make/remove an entry for the specified session
    2010-09-08T16:01:01.427246+10:00 quimby crond[14658]: CRON (root) ERROR: failed to open PAM security session: Success
    2010-09-08T16:01:01.427254+10:00 quimby crond[14658]: CRON (root) ERROR: cannot set security context
    
    Tried searching around but couldn't find any definite explanations on what's causing this. SELinux is disabled.

    Edit: Trying the fix at 0002191: pam_loginuid fails with message: set_loginuid failed opening loginuid - CentOS Bug Tracker and seeing if that fixes it.
    Edit 2: That appears to have fixed it. I edited the cpbackup cron to run now, and it ran correctly!
    Also see: http://linux-vserver.org/Frequently_Asked_Questions#Why_do_neither_sshd_nor_crond_.28vixie-cron.29_work_correctly_in_my_CentOS_.2F_Fedora_guest.3F_I_get_.27pam_loginuid.28crond:session.29:_set_loginuid_failed_opening_loginuid.27_and_similar_lines_in_my_logs. (I'm using Linux-Vserver)
     
    #9 Daniel15, Sep 8, 2010
    Last edited: Sep 8, 2010
  10. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Thank you for following-up with details about the resolution; the information is greatly appreciated. :)
     
  11. Daniel15

    Daniel15 Well-Known Member

    Joined:
    Oct 7, 2006
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    No worries, I thought it might be helpful to others. Now I just have to figure out what caused this issue. I'm using Linux-VServer and several vservers but actually own the server myself. I restarted the host server around the time it stopped working for kernel updates, so I might try and work out if an update was the cause. :)

    Too bad I didn't notice it until now! :rolleyes:
     
Loading...

Share This Page