source: LMDZ6/branches/IPSLCM6.0.15/tools/fcm/templates/utils/cron_template.ksh @ 5313

Last change on this file since 5313 was 1578, checked in by jghattas, 13 years ago
  • Add fcm in LMDZ5/tools directory

It is no longer needed to have fcm in your environement PATH variable.
Now makelmdz_fcm takes by default this fcm. It is still possible to use
another fcm, using -fcm_path argument in makelmdz_fcm.

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/usr/bin/ksh
2# ------------------------------------------------------------------------------
3# (C) Crown copyright Met Office. All rights reserved.
4# For further details please refer to the file COPYRIGHT.txt
5# which you should have received as part of this distribution.
6# ------------------------------------------------------------------------------
7
8lockfile='lock'
9
10if [[ -f $lockfile ]]; then
11  exit
12fi
13
14touch $lockfile
15
16headrevfile='latest'
17lastrevfile='lastrev'
18
19# Current HEAD revision
20if [[ ! -r $headrevfile ]]; then
21  echo "HEAD revision file $headrevfile cannot be read, abort" >&2
22  rm -f $lockfile
23  exit 1
24fi
25headrev=$(<$headrevfile)
26headrev=$(echo $headrev)
27
28# Revision at which this script is last run
29if [[ -r $lastrevfile ]]; then
30  lastrev=$(<$lastrevfile)
31  lastrev=$(echo $lastrev)
32else
33  lastrev=0
34fi
35
36# Exit if HEAD revision is the same as the last run revision
37if (($lastrev == $headrev)); then
38  rm -f $lockfile
39  exit 0
40fi
41
42# ------------------------------------------------------------------------------
43# Do something...
44# ------------------------------------------------------------------------------
45
46# Update last run revision file
47echo $headrev >$lastrevfile
48rm -f $lockfile
49
50# EOF
Note: See TracBrowser for help on using the repository browser.