Last change
on this file since 16 was
2,
checked in by pinsard, 13 years ago
|
first commit with original work of Francoise Pinsard
|
-
Property svn:executable set to
*
|
File size:
1.8 KB
|
Rev | Line | |
---|
[2] | 1 | #! /bin/sh |
---|
| 2 | #+ |
---|
| 3 | # |
---|
| 4 | # .. program:: tlogd.sh |
---|
| 5 | # |
---|
| 6 | # .. _tlogd.sh: |
---|
| 7 | # |
---|
| 8 | # ===================================================================================================== |
---|
| 9 | # tlogd.sh -- shows the most recent release of :file:`${TROPFLUX_LOG}/{action}.log.{YYYYMMDDTHHMMSSZ}` |
---|
| 10 | # ===================================================================================================== |
---|
| 11 | # |
---|
| 12 | # SYNOPSIS |
---|
| 13 | # ======== |
---|
| 14 | # |
---|
| 15 | # :: |
---|
| 16 | # |
---|
| 17 | # $ tlogd.sh action |
---|
| 18 | # |
---|
| 19 | # |
---|
| 20 | # DESCRIPTION |
---|
| 21 | # =========== |
---|
| 22 | # |
---|
| 23 | # ``tlogd.sh`` shows the most recent release of :file:`${TROPFLUX_LOG}/{action}.log.{YYYYMMDDTHHMMSSZ}` |
---|
| 24 | # |
---|
| 25 | # |
---|
| 26 | # SEE ALSO |
---|
| 27 | # ======== |
---|
| 28 | # |
---|
| 29 | # :ref:`tropflux_profile.sh` |
---|
| 30 | # |
---|
| 31 | # :ref:`dlogd.sh` |
---|
| 32 | # |
---|
| 33 | # :ref:`elogd.sh` |
---|
| 34 | # |
---|
| 35 | # :ref:`plogd.sh` |
---|
| 36 | # |
---|
| 37 | # EVOLUTIONS |
---|
| 38 | # ========== |
---|
| 39 | # |
---|
| 40 | # - fplod 20101213T150004Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 41 | # |
---|
| 42 | # * creation |
---|
| 43 | # |
---|
| 44 | #- |
---|
| 45 | # |
---|
| 46 | set -u |
---|
| 47 | system=$(uname) |
---|
| 48 | case "${system}" in |
---|
| 49 | AIX|IRIX64) |
---|
| 50 | echo " www : no specific posix checking" |
---|
| 51 | ;; |
---|
| 52 | *) |
---|
| 53 | set -o posix |
---|
| 54 | ;; |
---|
| 55 | esac |
---|
| 56 | unset system |
---|
| 57 | # |
---|
| 58 | LANG=POSIX |
---|
| 59 | # |
---|
| 60 | command=$(basename ${0}) |
---|
| 61 | # |
---|
| 62 | if [ "${1}" = "" ] |
---|
| 63 | then |
---|
| 64 | echo "${command} : eee : 1st parameter missing" >&2 |
---|
| 65 | exit 1 |
---|
| 66 | fi |
---|
| 67 | # check for ${TROPFLUX_LOG} definition |
---|
| 68 | if [ "${TROPFLUX_LOG}" = "" ] |
---|
| 69 | then |
---|
| 70 | echo " eee : \${TROPFLUX_LOG} not defined" |
---|
| 71 | exit 1 |
---|
| 72 | fi |
---|
| 73 | # |
---|
| 74 | # check for ${TROPFLUX_LOG} existence |
---|
| 75 | if [ ! -d ${TROPFLUX_LOG} ] |
---|
| 76 | then |
---|
| 77 | echo " eee : ${TROPFLUX_LOG} not found" |
---|
| 78 | exit 1 |
---|
| 79 | fi |
---|
| 80 | # |
---|
| 81 | # check for permission access on TROPFLUX_LOG |
---|
| 82 | if [ ! -x ${TROPFLUX_LOG} ] |
---|
| 83 | then |
---|
| 84 | echo " eee : ${TROPFLUX_LOG} not reachable" |
---|
| 85 | exit 1 |
---|
| 86 | fi |
---|
| 87 | # |
---|
| 88 | log=$(find ${TROPFLUX_LOG} -name "${1}.log.????????T??????Z" 2> /dev/null | sort | \ |
---|
| 89 | tail -n 1) |
---|
| 90 | tmp=${?} |
---|
| 91 | if [ ${tmp} -eq 0 ] |
---|
| 92 | then |
---|
| 93 | if [ "${log}" = "" ] |
---|
| 94 | then |
---|
| 95 | echo "${command} : eee : no release of ${TROPFLUX_LOG}/${1}.log" >&2 |
---|
| 96 | exit 1 |
---|
| 97 | else |
---|
| 98 | more ${log} |
---|
| 99 | exit 0 |
---|
| 100 | fi |
---|
| 101 | else |
---|
| 102 | exit 1 |
---|
| 103 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.