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 | # dlogd.sh - prompt for destruction of the most recent release of ${IRCAAM_LOG}/action.log.YYYY-MM-DDTHH:MM:SSZ |
---|
9 | # |
---|
10 | # |
---|
11 | # SYNOPSIS |
---|
12 | # ======== |
---|
13 | # |
---|
14 | # :: |
---|
15 | # |
---|
16 | # $ dlogd.sh action |
---|
17 | # |
---|
18 | # |
---|
19 | # DESCRIPTION |
---|
20 | # =========== |
---|
21 | # |
---|
22 | # ``dlogd.sh`` prompt for destruction of the most recent release of ${IRCAAM_LOG}/action.log.YYYY-MM-DDTHH:MM:SSZ. |
---|
23 | # |
---|
24 | # |
---|
25 | # SEE ALSO |
---|
26 | # ======== |
---|
27 | # |
---|
28 | # ircaam_profile.sh_ |
---|
29 | # |
---|
30 | # .. _ircaam_profile.sh : ircaam_profile.sh.html |
---|
31 | # |
---|
32 | # elogd.sh_ |
---|
33 | # |
---|
34 | # .. _elogd.sh : elogd.sh.html |
---|
35 | # |
---|
36 | # plogd.sh_ |
---|
37 | # |
---|
38 | # .. _plogd.sh : plogd.sh.html |
---|
39 | # |
---|
40 | # tlogd.sh_ |
---|
41 | # |
---|
42 | # .. _tlogd.sh : tlogd.sh.html |
---|
43 | # |
---|
44 | # FILES |
---|
45 | # ===== |
---|
46 | # |
---|
47 | # original location |
---|
48 | # ~~~~~~~~~~~~~~~~~ |
---|
49 | # |
---|
50 | # /usr/home/fplod/incas/ircaam/ircaam_ws/src/dlogd.sh sur cerbere.locean-ipsl.upmc.fr |
---|
51 | # |
---|
52 | # EVOLUTIONS |
---|
53 | # ========== |
---|
54 | # |
---|
55 | # $Id$ |
---|
56 | # |
---|
57 | # - fplod 2006-02-20T16:44:33Z aedon.lodyc.jussieu.fr (Darwin) |
---|
58 | # |
---|
59 | # * posix |
---|
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 | command=$(basename ${0}) |
---|
74 | # |
---|
75 | if [ "${1}" = "" ] |
---|
76 | then |
---|
77 | echo "${command} : eee : 1st parameter missing" >&2 |
---|
78 | exit 1 |
---|
79 | fi |
---|
80 | # |
---|
81 | # check for ${IRCAAM_LOG} definition |
---|
82 | if [ "${IRCAAM_LOG}" = "" ] |
---|
83 | then |
---|
84 | echo " eee : \${IRCAAM_LOG} not defined" |
---|
85 | exit 1 |
---|
86 | fi |
---|
87 | # |
---|
88 | # check for ${IRCAAM_LOG} existence |
---|
89 | if [ ! -d ${IRCAAM_LOG} ] |
---|
90 | then |
---|
91 | echo " eee : ${IRCAAM_LOG} not found" |
---|
92 | exit 1 |
---|
93 | fi |
---|
94 | # |
---|
95 | # check for permission access on IRCAAM_LOG |
---|
96 | if [ ! -x ${IRCAAM_LOG} ] |
---|
97 | then |
---|
98 | echo " eee : ${IRCAAM_LOG} not reachable" |
---|
99 | exit 1 |
---|
100 | fi |
---|
101 | # check for write permission on IRCAAM_LOG |
---|
102 | if [ ! -w ${IRCAAM_LOG} ] |
---|
103 | then |
---|
104 | echo " eee : ${IRCAAM_LOG} not writable" |
---|
105 | exit 1 |
---|
106 | fi |
---|
107 | # |
---|
108 | log=$(find ${IRCAAM_LOG} -name "${1}.log.????-??-??T??:??:??Z" | sort | \ |
---|
109 | tail -n 1) |
---|
110 | tmp=${?} |
---|
111 | if [ ${tmp} -eq 0 ] |
---|
112 | then |
---|
113 | if [ "${log}" = "" ] |
---|
114 | then |
---|
115 | echo "${command} : eee : no release of ${IRCAAM_LOG}/${1}.log" >&2 |
---|
116 | exit 1 |
---|
117 | else |
---|
118 | # destruction du fichier ${log} |
---|
119 | /bin/rm -i ${log} |
---|
120 | exit 0 |
---|
121 | fi |
---|
122 | else |
---|
123 | exit 1 |
---|
124 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.