Sponsored Content
Top Forums Shell Programming and Scripting How to find the router reboot date using script? Post 302770071 by Corona688 on Thursday 14th of February 2013 10:59:40 AM
Old 02-14-2013
Code:
OLDIFS="$IFS"
IFS="${IFS},"

set -- `show version | grep Time`

IFS="$OLDIFS"

while [ "$#" -gt 0 ] && [ "$1" != "-" ] ; do shift ; done

shift

S=0

while [ "$#" -gt 0 ]
do
        case "$2" in
        day*) let S=S+${1}*60*60*24 ;;
        hour*) let S=S+${1}*60*60 ;;
        minute*) let S=S+${1}*60 ;;
        second*) let S=S+${1} ;;
        esac

        shift 2
done

DATE=$(perl -e 'use POSIX qw(strftime);  print strftime "%m %d %H %M %S\n", localtime(time()+$ARGV[0]);' -- -${S} )

Adjust strftime to taste by changing its format string, see man strftime, it takes the same options.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to find files on a given input date

Hello gurus, I need to write a script to find out all the file that got changed on a specific folder since a given input date (Date to be given as Input) Thanx (1 Reply)
Discussion started by: ar.karan
1 Replies

2. UNIX for Dummies Questions & Answers

shell script to find files by date and size

Hi, I have a directory PRIVATE in which I have several directories and each of these have several files. Therefore, I need to find those files by size and date to back up those files in another directory. I don't know how to implement this shell script using ''find''. appreciate any... (1 Reply)
Discussion started by: dadadc
1 Replies

3. AIX

How to find the router IP address

How to find the router IP address (2 Replies)
Discussion started by: AIXlearner
2 Replies

4. Shell Programming and Scripting

How to script to find the newer date in a text file?

Hi, I have a text file, foo.txt, it looks something like below. In the file there is a line that gives the date in the form of: Mon Jun 15 11:09:31 2008. I need to find which date is the newest and then store certain details of that list data to another file. So, in this sample text file, I... (6 Replies)
Discussion started by: boolean2222
6 Replies

5. UNIX for Dummies Questions & Answers

Remote Unix printing to my WinXP works with no router. How can I make it work through my router?

I set up remote printing on a clients Unix server to my Windows XP USB printer. My USB printer is connected directly to my PC (no print server and no network input on printer). With my Win XP PC connected to my cable modem (without the router), i can do lp -dhp842c /etc/hosts and it prints. I... (7 Replies)
Discussion started by: jmhohne
7 Replies

6. Shell Programming and Scripting

How to find the date of previous day in shell script?

Hi Experts, i am using the below code get the date of previous day. #!/usr/bin/ksh datestamp=`date '+%Y%m%d'` yest=$((datestamp -1)) echo $yest When i execute the code i am getting output as: 20130715 What i am trying here is, based on the date passed i am fetching previus day's... (0 Replies)
Discussion started by: learner24
0 Replies

7. Red Hat

How to find out what router a connection uses?

How can i trace a destination IP from the initiating IP to see what router(s) it goes thru from the source IP to the destination IP on Linux Redhat server? If it is the traceroute command, what options can i Use to get that infoirmation? Thanks (2 Replies)
Discussion started by: mrn6430
2 Replies

8. UNIX for Beginners Questions & Answers

Script to find a date variable and increment it

Hi, I have parameter file wo_location.prm which has a date variable $last_upd_date= 02032016. I need to write a unix shell script to find that variable and increment it by 1 day. The path to the file is root/dir_lc/shared/param/wo_location.prm and the variable is $last_upd_date. Any... (2 Replies)
Discussion started by: isenhiem
2 Replies

9. Shell Programming and Scripting

Script to find n.of weekdays and n.of weekends in a given date

Hi All, Could you please provide the shell script to find number of weekdays and number of weekends for a given date for that month. Monday to friday should be considered as weekdays and Saturday and Sunday should be considered as weekends. Date should be passed as parameter. For... (13 Replies)
Discussion started by: ROCK_PLSQL
13 Replies
rdpd(1M)																  rdpd(1M)

NAME
rdpd - router discovery protocol daemon (OBSOLETE) SYNOPSIS
| | DESCRIPTION
the router discover protocol daemon, implements the host portion of the router discovery protocol (see More specifically o solicits router advertisements when it is first started so as to populate the kernel table as soon as possible. o listens on all ethernet interfaces (that are up) for ICMP router advertisement datagrams. o adds a default router to the kernel table based on whether the router is a neighbor and has the highest preference among all advertisements received. o ages the default router entry applied to the kernel table based on the lifetime value found in the advertisement message. can be started during boot-time initialization. To do so, see (But see below.) Options supports the following options: Display the version of Enable tracing of the following events: o setting of expiration timer for advertised entry. o expiration of a router advertisement entry (only the active entry has a timer running). o add/update of an advertised router to the kernel. o removal from kernel table of an advertised router. o reception of a router advertisement from the link. o transmission of a router solicitation message. o failure while attempting to transmit a solicitation. Enable verbose tracing, which in addition to the above, traces: o contents of the router advertisement message received. o contents of rdpd internal statics which includes: 1. total number of messages received, 2. total number advertisements received, 3. total number of advertisements with invalid number of addresses field, 4. total number of advertisements with invalid address size field, 5. total number of advertisements with invalid message lengths, 6. total number of advertisements with invalid lifetime fields, 7. total number of messages with number of bytes received <> header length field. LIMITATIONS
1. The maximum number of default routes retained is 10. Only one of which is applied to the kernel routing tables (the one with the high- est preference). In the event that the advertised router with the highest preference expires the retained advertised router list will be searched for the highest preference, still current entry and that entry will be applied to the kernel table. This allows for quick recovery from aged advertisements. 2. only becomes aware of link state changes when either a new Router Advertisement message is received or a timer pops to age a currently active default router added by This may cause a delay between an interface state change (e.g., down) and any necessary change to the kernel routing table. 3. The "all hosts on subnet" broadcast address is used for sending solicitations instead of either the all-routers multicast or limited- broadcast IP addresses. 4. The limited-broadcast address for inbound Advertisements is assumed. 5. Default routers added via the command can be altered due to Router Advertisements for the same router. 6. Adding default routes via the command can cause unpredictable results and should be avoided. OBSOLESCENCE
The functionality of has been subsumed in See the statements described in gated.conf(4). has been obsoleted in HP-UX 11i Version 2. WARNINGS
should not be used if is enabled when running AUTHOR
was developed by HP. SEE ALSO
gated(1M), gated.conf(4). [1] Deering, S., "ICMP Router Discovery Messages", RFC 1256 rdpd(1M)
All times are GMT -4. The time now is 01:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy