source: trunk/src/tlogd.sh @ 2

Last change on this file since 2 was 2, checked in by pinsard, 15 years ago

first commit with original work of Francoise Pinsard

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1#! /bin/sh
2#
3#+
4#
5# NAME
6# ====
7#
8# tlogd.sh -  shows the most recent release of ${IRCAAM_LOG}/<action>.log.YYYY-MM-DDTHH:MM:SSZ
9#
10# SYNOPSIS
11# ========
12#
13# ::
14#
15#  $ tlogd.sh action
16#
17#
18# DESCRIPTION
19# ===========
20#
21# ``tlogd.sh`` shows the most recent release of ${IRCAAM_LOG}/action.log.YYYY-MM-DDTHH:MM:SSZ.
22#
23#
24# SEE ALSO
25# ========
26#
27# ircaam_profile.sh_
28#
29# .. _ircaam_profile.sh : ircaam_profile.sh.html
30#
31# dlogd.sh_
32#
33# .. _dlogd.sh : dlogd.sh.html
34#
35# elogd.sh_
36#
37# .. _elogd.sh : elogd.sh.html
38#
39# plogd.sh_
40#
41# .. _plogd.sh : plogd.sh.html
42#
43#
44# FILES
45# =====
46#
47# original location
48# ~~~~~~~~~~~~~~~~~
49#
50# /usr/home/fplod/incas/ircaam/ircaam_ws/src/tlogd.sh sur cerbere.locean-ipsl.upmc.fr
51#
52# EVOLUTIONS
53# ==========
54#
55# $Id$
56#
57# - fplod 2008-11-26T10:13:13Z aedon.locean-ipsl.upmc.fr (Darwin)
58#
59#   * replace PROJECT_LOG by IRCAAM_LOG
60#
61# - fplod 2008-03-18T09:15:57Z ajax.locean-ipsl.upmc.fr (Linux)
62#
63#   * replace FORVAN_LOG by PROJECT_LOG
64#
65# - fplod 2006-02-20T16:08:33Z aedon.lodyc.jussieu.fr (Darwin)
66#
67#   * posix
68#
69#-
70#
71set -u
72system=$(uname)
73case "${system}" in
74AIX|IRIX64)
75  echo " www : no specific posix checking"
76;;
77*)
78  set -o posix
79;;
80esac
81#
82command=$(basename ${0})
83#
84if [ "${1}" = "" ]
85then
86 echo "${command} : eee : 1st parameter missing" >&2
87 exit 1
88fi
89# check for ${IRCAAM_LOG} definition
90if [ "${IRCAAM_LOG}" = "" ]
91then
92 echo " eee : \${IRCAAM_LOG} not defined"
93 exit 1
94fi
95#
96# check for ${IRCAAM_LOG} existence
97if [ ! -d ${IRCAAM_LOG} ]
98then
99 echo " eee : ${IRCAAM_LOG} not found"
100 exit 1
101fi
102#
103# check for permission access on IRCAAM_LOG
104if [ ! -x ${IRCAAM_LOG} ]
105then
106 echo " eee : ${IRCAAM_LOG} not reachable"
107 exit 1
108fi
109#
110log=$(find ${IRCAAM_LOG} -name "${1}.log.????-??-??T??:??:??Z" 2> /dev/null | sort | \
111tail -n 1)
112tmp=${?}
113if [ ${tmp} -eq 0 ]
114then
115 if [ "${log}" = "" ]
116 then
117  echo "${command} : eee : no release of ${IRCAAM_LOG}/${1}.log" >&2
118  exit 1
119 else
120  more ${log}
121  exit 0
122 fi
123else
124 exit 1
125fi
Note: See TracBrowser for help on using the repository browser.