Sponsored Content
Top Forums Shell Programming and Scripting to check the Linux upgrade in the host Post 302400278 by drl on Tuesday 2nd of March 2010 09:06:18 PM
Old 03-02-2010
Hi.

I use CentOS 5.4, the free version of RedHat. I looked in /var/log, and found some logs for "yum". Here is a script that shows a sample of when some updates were made:
Code:
#!/usr/bin/env bash

# @(#) s1	Demonstrate time of update.

echo
echo "(Versions displayed with local utility \"version\")"
version >/dev/null 2>&1 && version =o $(_eat $0 $1) 
set -o nounset
echo


ls -l /var/log/yum*

echo
head -3 /var/log/yum.log

exit 0

producing:
Code:
$ ./s1

(Versions displayed with local utility "version")
OS, ker|rel, machine: Linux, 2.6.18-164.11.1.el5, i686
Distribution        : CentOS release 5.4 (Final)
GNU bash 3.2.25

-rw-r--r-- 1 root root  3308 Feb  5 12:00 /var/log/yum.log
-rw-r--r-- 1 root root 43464 Dec 23 18:33 /var/log/yum.log.1
-rw-r--r-- 1 root root 38360 Jan  2  2009 /var/log/yum.log.2

Feb 05 11:50:24 Updated: selinux-policy-2.4.6-255.el5_4.4.noarch
Feb 05 11:50:31 Updated: kernel-headers-2.6.18-164.11.1.el5.i386
Feb 05 11:50:50 Updated: tzdata-2009u-1.el5.noarch

I have no idea if this is always the case for an update. The files may contain more than one set of updates, so you may need to process to collect the unique dates.

Best wishes ... cheers, drl
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check host file for duplicate entries

I need a KSH script that will check a host file for duplicate IP's and/or host names and report out the errors. Anyone out there have one they would like to share? Something like: Hostname blahblah appears X times IP Address xxx.xxx.xxx.xxx appears X times TIA (4 Replies)
Discussion started by: ThreeDot
4 Replies

2. UNIX for Dummies Questions & Answers

Bash Script to check Remote Host Connection

Hi all, Can anyone tell/guide me how to check remote host is up/running using bash script? Thanks. Zulfiqar (5 Replies)
Discussion started by: zulfikarmd
5 Replies

3. Shell Programming and Scripting

check ssh connection to remote host

I am using KSH and I need to check whether the remote host has been configured with ssh public key. Is there any way we can check inside a script? (6 Replies)
Discussion started by: praveenbvarrier
6 Replies

4. Shell Programming and Scripting

command to check whether the remote host is up or not

Hi, My script needs to check whether the remote host is up or not. If it is up i need to start few servers in that host or else just a notification should be sent that the remote host is down? Could someone help me out in this? Regards Arun (4 Replies)
Discussion started by: arunkumarmc
4 Replies

5. Red Hat

Linux - update/upgrade

Hi, I'm interesting do you have a some solution/good practice how upgrade/update OS with possibility to back previously release (something like Live upgrade in Solaris) ? thanks. (2 Replies)
Discussion started by: deivo
2 Replies

6. Shell Programming and Scripting

Script to check if host key authentication is setup

Hey all, I have a script that I use for some automated installs. Unfortunately for the script to work the server that it's running from needs to have host-key authentication setup to the target server. If it isn't setup beforehand and the script is executed the install partially completes and... (1 Reply)
Discussion started by: Rike255
1 Replies

7. UNIX for Dummies Questions & Answers

Check port 2222 is open on a remote host

I am able to connect to a remote host using the legacy IP and port 2222. Today the remote has a new IP I am unable to connect. How to check if the remote host is blocking or if its my server is unable to connect. Err Msg : telnet: Unable to connect to remote host: Connection refused Err... (5 Replies)
Discussion started by: ITDev01
5 Replies

8. SCO

Upgrade SCO 5.0.2 Host to Enterprise with license

Hello, I have an old system SCO 5.0.2 HOST (without network) and some applications on this machine. Theses applications are not installable again on other system because i have not the routines. And it's now necessary to connect this old system on local network for a "new" application. I have SCO... (13 Replies)
Discussion started by: Lm76
13 Replies

9. Solaris

Solaris live upgrade - how to check if a fs is shared or not

Hi all, 1) how do i check which FS(filesystems) in the current active PBE are shared and not shared with the ABE (alternate boot env) ? is doing lufslist and comparing between the 2 BEs the only option ? 2) when doing a luactivate -s (synchronize), does the synchronization go both way... (0 Replies)
Discussion started by: javanoob
0 Replies

10. UNIX for Beginners Questions & Answers

SFTP file check through a remote host

Hi all, posting my first time, hope not breaking posting rules with it, if yes, let me know. I'm trying to build a script to check a file in an sftp server through a remote server. The intention is to check the file in a sftp host, and if the file is found or not, it should send an email.... (4 Replies)
Discussion started by: MrShinyPants
4 Replies
debuginfo-install(1)													      debuginfo-install(1)

NAME
debuginfo-install - install debuginfo packages and their dependencies SYNOPSIS
debuginfo-install package DESCRIPTION
debuginfo-install is a program which installs the RPMs needed to debug the specified package. The package argument can be a wildcard, but will only match installed packages. debuginfo-install will then enable any debuginfo repositories, and install the relevant debuginfo rpm. EXAMPLES
Download and install all the RPMs needed to debug the kernel RPM: debuginfo-install kernel WARNING MESSAGES
Could not find debuginfo for: You may sometimes see warning messages about certain packages not being found if you run debuginfo-install for a wildcard or glob. Debuginfo packages are not necessary for "noarch" RPMs; these will generate a warning message. Additionally, On 64-bit systems, no multilib debuginfo packages are published, so if you have 32-bit packages installed, these will also generate warning messages. FILES
As debuginfo-install uses YUM libraries for retrieving all the information, it relies on YUM configuration for its default values like which repositories to use. Consult YUM documentation for details: /etc/yum.conf /etc/yum/repos.d/ /var/cache/yum/ SEE ALSO
yum.conf (5) http://yum-utils.baseurl.org/ http://yum.baseurl.org/ AUTHORS
See the Authors file included with this program. BUGS
There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org. To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs. James Antill 21 October 2008 debuginfo-install(1)
All times are GMT -4. The time now is 04:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy