Last change
on this file since 11 was
11,
checked in by pinsard, 15 years ago
|
smal typo for doc
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Id
|
File size:
1.7 KB
|
Line | |
---|
1 | #! /bin/sh |
---|
2 | # |
---|
3 | #+ |
---|
4 | # |
---|
5 | # NAME |
---|
6 | # ==== |
---|
7 | # |
---|
8 | # tlogd.sh - shows the most recent release of ${VARAMMA_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 ${VARAMMA_LOG}/action.log.YYYY-MM-DDTHH:MM:SSZ. |
---|
22 | # |
---|
23 | # |
---|
24 | # SEE ALSO |
---|
25 | # ======== |
---|
26 | # |
---|
27 | # varamma_profile.sh_ |
---|
28 | # |
---|
29 | # .. _varamma_profile.sh : varamma_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/varamma/varamma_ws/src/tlogd.sh sur aedon.locean-ipsl.upmc.fr |
---|
51 | # |
---|
52 | # EVOLUTIONS |
---|
53 | # ========== |
---|
54 | # |
---|
55 | # $Id$ |
---|
56 | # |
---|
57 | # - fplod 2008-11-26T11:26:40Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
58 | # |
---|
59 | # * creation |
---|
60 | # |
---|
61 | #- |
---|
62 | # |
---|
63 | set -u |
---|
64 | system=$(uname) |
---|
65 | case "${system}" in |
---|
66 | AIX|IRIX64) |
---|
67 | echo " www : no specific posix checking" |
---|
68 | ;; |
---|
69 | *) |
---|
70 | set -o posix |
---|
71 | ;; |
---|
72 | esac |
---|
73 | # |
---|
74 | command=$(basename ${0}) |
---|
75 | # |
---|
76 | if [ "${1}" = "" ] |
---|
77 | then |
---|
78 | echo "${command} : eee : 1st parameter missing" >&2 |
---|
79 | exit 1 |
---|
80 | fi |
---|
81 | # check for ${VARAMMA_LOG} definition |
---|
82 | if [ "${VARAMMA_LOG}" = "" ] |
---|
83 | then |
---|
84 | echo " eee : \${VARAMMA_LOG} not defined" |
---|
85 | exit 1 |
---|
86 | fi |
---|
87 | # |
---|
88 | # check for ${VARAMMA_LOG} existence |
---|
89 | if [ ! -d ${VARAMMA_LOG} ] |
---|
90 | then |
---|
91 | echo " eee : ${VARAMMA_LOG} not found" |
---|
92 | exit 1 |
---|
93 | fi |
---|
94 | # |
---|
95 | # check for permission access on VARAMMA_LOG |
---|
96 | if [ ! -x ${VARAMMA_LOG} ] |
---|
97 | then |
---|
98 | echo " eee : ${VARAMMA_LOG} not reachable" |
---|
99 | exit 1 |
---|
100 | fi |
---|
101 | # |
---|
102 | log=$(find ${VARAMMA_LOG} -name "${1}.log.????-??-??T??:??:??Z" 2> /dev/null | sort | \ |
---|
103 | tail -n 1) |
---|
104 | tmp=${?} |
---|
105 | if [ ${tmp} -eq 0 ] |
---|
106 | then |
---|
107 | if [ "${log}" = "" ] |
---|
108 | then |
---|
109 | echo "${command} : eee : no release of ${VARAMMA_LOG}/${1}.log" >&2 |
---|
110 | exit 1 |
---|
111 | else |
---|
112 | more ${log} |
---|
113 | exit 0 |
---|
114 | fi |
---|
115 | else |
---|
116 | exit 1 |
---|
117 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.