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
YUM-CHANGELOG.CONF(5)						   File Formats 					     YUM-CHANGELOG.CONF(5)

NAME
yum-changelog.conf(5) SYNOPSIS
yum-changelog.conf(5) is the configuration file for yum-changelog(1) Yum plugin for viewing package changelogs before/after updating. By default, this plugin will show the changelogs before the updates. FILES
/etc/yum/pluginconf.d/changelog.conf FILE FORMAT
yum-changelog.conf(5) utilizes configuration options in the form of OPTION=VALUE OPTION
when This option reflects when yum-changelog(1) will allow changelog viewing during yum updates. VALUE
pre To make yum-changelog(5) show the changelog before the yum updates post To make yum-changelog(5) show the changelog after the yum updates. OPTION
always This option reflects specifies if the changelog should always be shown. VALUE
true The changelog is always displayed. false A command line option is required for the changelog to be displayed. OPTION
updateinfo This option specifies that the "changelog" from the repo. updateinfo should be shown. VALUE
true The updateinfo is displayed. false The updateinfo is never displayed. OPTION
updateinfo_always This option reflects specifies if the "changelog" from the repo. should always be shown (note that if updateinfo is false then this option has no meaning). VALUE
true The updateinfo is always displayed. false A command line option is required for the updateinfo to be displayed. AUTHOR
Chitlesh Goorah <chitlesh@fedoraproject.org> SEE ALSO
yum-changelog(1) 08 FEBRUARY 2007 YUM-CHANGELOG.CONF(5)
All times are GMT -4. The time now is 09:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy