source: branches/locker-dev/locker/bin/cronload @ 1563

Last change on this file since 1563 was 1563, checked in by adehnert, 12 years ago
Be saner about finding lockername in cronload
  • Property svn:executable set to *
File size: 970 bytes
Line 
1#!/bin/sh
2
3usage="Usage \"$0 [-l lockername] crontab\""
4while getopts "l:h" options; do
5    case $options in
6        l ) lname=$OPTARG;;
7        h ) echo "$usage"; exit 0;;
8        \? ) echo "$usage"
9            exit 1;;
10        * ) echo "$usage"
11            exit 1;;
12    esac
13done
14shift `expr $OPTIND - 1`
15if [ -z "$1" ]; then
16    echo "$usage"
17    exit 1
18fi
19
20echo "This program should print your new crontab below."
21echo "If it does not do so, something is wrong."
22echo "Feel free to contact scripts@mit.edu for assistance."
23echo
24
25
26cwd=`pwd`
27if [ -z "$lname" ]; then
28    lname=`perl -e "\\\$temp = \"$cwd\"; \\\$temp =~ /\\\/([^\\\/]+)\\\/cron_scripts/; print \\\$1"`
29fi
30if [ -z "$lname" ]; then
31    echo "ERROR: Could not detect locker name. Make sure to run"
32    echo "cronload from within /mit/lockername/cron_scripts/"
33    echo "(or pass the -l lockername option)"
34    exit 1
35fi
36athrun scripts scripts-ssh "$lname" /usr/local/bin/cronload "$1" "$cwd" 2>/dev/null
Note: See TracBrowser for help on using the repository browser.