Get the most out of your Centmin Mod LEMP stack
Become a Member

Automatic nightly YUM updates with yum-cron for CentOS 7 Only

Discussion in 'System Administration' started by eva2000, Sep 28, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    12:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    no idea, maybe your timezone is different, check using date command

    tzdata updated for me
    Code:
    date
    Sun Oct  5 02:31:32 UTC 2014
    Code:
    yum history list tzdata
    Loaded plugins: downloadonly, fastestmirror, priorities
    ID     | Login user               | Date and time    | Action(s)      | Altered
    -------------------------------------------------------------------------------
       104 | root <root>              | 2014-10-04 03:17 | Update         |    1 
        99 | root <root>              | 2014-09-24 17:52 | I, U           |   10 
         1 | System <unset>           | 2014-06-30 10:11 | Install        |  200 
    Code:
     yum history info 104
    Loaded plugins: downloadonly, fastestmirror, priorities
    Transaction ID : 104
    Begin time     : Sat Oct  4 03:17:03 2014
    Begin rpmdb    : 467:8f81eda737a2b346ec43e76c9ce59683bec48473
    End time       :            03:17:04 2014 (1 seconds)
    End rpmdb      : 467:5eb629bcf34e3c5d873f8184baf741432e83a385
    User           : root <root>
    Return-Code    : Success
    Command Line   : -e 0 -d 0 -y shell /etc/yum/yum-daily.yum
    Additional non-default information stored: 1
    Transaction performed with:
        Installed     rpm-4.8.0-37.el6.x86_64                         @anaconda-CentOS-201311291202.x86_64/6.5
        Installed     yum-3.2.29-43.el6.centos.noarch                 @CentOS-Updates/6.5
        Installed     yum-plugin-fastestmirror-1.1.30-17.el6_5.noarch @CentOS-Updates/6.5
    Packages Altered:
        Updated tzdata-2014g-1.el6.noarch @updates
        Update         2014h-1.el6.noarch @updates
    history info
    give it another day or so

     
  2. rdan

    rdan Well-Known Member

    5,444
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    10:04 AM
    Mainline
    10.2
    Yes my date is different and based on my location timezone.
    Code:
    # yum history list tzdata
    Loaded plugins: downloadonly, fastestmirror, priorities
    ID     | Login user               | Date and time    | Action(s)      | Altered
    -------------------------------------------------------------------------------
         2 | root <root>              | 2014-09-19 11:27 | I, U           |   59
         1 | System <unset>           | 2014-09-19 11:21 | Install        |  217
    history list
    
    I'll give it another day and see :)
     
  3. rdan

    rdan Well-Known Member

    5,444
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    10:04 AM
    Mainline
    10.2
    Confirmed, for 3 days I let it run the update.
    Outcome is, not working on my server :/
    Still the update is there when i run yum update.
    How to fix/debug this?
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    12:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    maybe try manual update and see if there maybe errors preventing update
     
  5. rdan

    rdan Well-Known Member

    5,444
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    10:04 AM
    Mainline
    10.2
    I don't have problems.
    Code:
    # yum update
    Loaded plugins: downloadonly, fastestmirror, priorities
    Loading mirror speeds from cached hostfile
    epel/metalink                                                                                               |  15 kB     00:00
    * base: centos.bhs.mirrors.ovh.net
    * epel: mirrors.einstein.yu.edu
    * extras: less.cogeco.net
    * rpmforge: repoforge.mirror.constant.com
    * updates: centos.mirror.gtcomm.net
    base                                                                                                        | 3.7 kB     00:00
    extras                                                                                                      | 3.3 kB     00:00
    mariadb                                                                                                     | 1.9 kB     00:00
    rpmforge                                                                                                    | 1.9 kB     00:00
    updates                                                                                                     | 3.4 kB     00:00
    1582 packages excluded due to repository priority protections
    Setting up Update Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package tzdata.noarch 0:2014g-1.el6 will be updated
    ---> Package tzdata.noarch 0:2014h-1.el6 will be an update
    ---> Package tzdata-java.noarch 0:2014g-1.el6 will be updated
    ---> Package tzdata-java.noarch 0:2014h-1.el6 will be an update
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ===================================================================================================================================
    Package                          Arch                        Version                           Repository                    Size
    ===================================================================================================================================
    Updating:
    tzdata                           noarch                      2014h-1.el6                       updates                      449 k
    tzdata-java                      noarch                      2014h-1.el6                       updates                      176 k
    
    Transaction Summary
    ===================================================================================================================================
    Upgrade       2 Package(s)
    
    Total download size: 625 k
    Is this ok [y/N]: y
    Downloading Packages:
    (1/2): tzdata-2014h-1.el6.noarch.rpm                                                                        | 449 kB     00:00
    (2/2): tzdata-java-2014h-1.el6.noarch.rpm                                                                   | 176 kB     00:00
    -----------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                              3.0 MB/s | 625 kB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Updating   : tzdata-java-2014h-1.el6.noarch                                                                                  1/4
      Updating   : tzdata-2014h-1.el6.noarch                                                                                       2/4
      Cleanup    : tzdata-java-2014g-1.el6.noarch                                                                                  3/4
      Cleanup    : tzdata-2014g-1.el6.noarch                                                                                       4/4
      Verifying  : tzdata-2014h-1.el6.noarch                                                                                       1/4
      Verifying  : tzdata-java-2014h-1.el6.noarch                                                                                  2/4
      Verifying  : tzdata-2014g-1.el6.noarch                                                                                       3/4
      Verifying  : tzdata-java-2014g-1.el6.noarch                                                                                  4/4
    
    Updated:
      tzdata.noarch 0:2014h-1.el6                                   tzdata-java.noarch 0:2014h-1.el6
    
    Complete!
    
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    12:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what does cron log say for past few days ? other cron jobs still run ?
     
  7. rdan

    rdan Well-Known Member

    5,444
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    10:04 AM
    Mainline
    10.2
    Looks like running fine the other day: Automatic nightly YUM updates with yum-cron | Centmin Mod Community
    And also, It's running today.
    But how come it didn't update?

    yeah all other crons are running, like my backup script, deferred.php on my XenForo forum is also running via cron.
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    12:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  9. rdan

    rdan Well-Known Member

    5,444
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    10:04 AM
    Mainline
    10.2
    I still didn't receive an update.
    What update do you receive today?
     
  10. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    12:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    no updates today just meant in general :)
     
  11. rdan

    rdan Well-Known Member

    5,444
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    10:04 AM
    Mainline
    10.2
    I can't say it's working already until I receive an email regarding an update :)
     
  12. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    12:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah only update recently was openssl heh
     
  13. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    12:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  14. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    12:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  15. jeffwidman

    jeffwidman Active Member

    152
    27
    28
    Dec 3, 2014
    Ratings:
    +51
    Local Time:
    6:04 PM
    Thanks for the instructions. Was just going to look up how to do this and of course George is already on top of it.

    Also, fyi per here: RHEL7: Configure automatic updates. - CertDepot

    "/etc/yum/yum-cron-hourly.conf defines what is done once every hour."

    I have that set to run the security updates every hour. And then notify, but don't download the normal updates once a day. Like Matt, I prefer to minimize updating until I verify what it is, but as a one-man shop, there's too much chance I'll miss something so rather security updates just run unattended.
     
  16. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    12:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    nice added /etc/yum/yum-cron-hourly.conf info for CentOS 7 to first post !
     
  17. Eduardo

    Eduardo Member

    38
    3
    8
    Feb 7, 2015
    Ratings:
    +5
    Local Time:
    11:04 PM
    1.7.9
    ideas?
     
  18. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    12:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    using VPS ? make sure VPS host hasn't blocked email sending... vultr and incero/wable are 2 VPS providers who block email sending out by default. The vultr you can contact them to unblock.
     
  19. Eduardo

    Eduardo Member

    38
    3
    8
    Feb 7, 2015
    Ratings:
    +5
    Local Time:
    11:04 PM
    1.7.9
    yum-cron uses smtp to send email and my setup don't have traditional mtas, I'm using ssmtp, it don't have smtp.

    sorry ;)
     
  20. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    12:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    this Centmin Mod LEMP stack server ? if not can't help you there.. should work fine with properly setup Centmin Mod LEMP stack that uses postfix MTA