|
Last change
on this file since 1563 was
1563,
checked in by adehnert, 15 years ago
|
|
Be saner about finding lockername in cronload
|
-
Property svn:executable set to
*
|
|
File size:
970 bytes
|
| Line | |
|---|
| 1 | #!/bin/sh |
|---|
| 2 | |
|---|
| 3 | usage="Usage \"$0 [-l lockername] crontab\"" |
|---|
| 4 | while 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 |
|---|
| 13 | done |
|---|
| 14 | shift `expr $OPTIND - 1` |
|---|
| 15 | if [ -z "$1" ]; then |
|---|
| 16 | echo "$usage" |
|---|
| 17 | exit 1 |
|---|
| 18 | fi |
|---|
| 19 | |
|---|
| 20 | echo "This program should print your new crontab below." |
|---|
| 21 | echo "If it does not do so, something is wrong." |
|---|
| 22 | echo "Feel free to contact scripts@mit.edu for assistance." |
|---|
| 23 | echo |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | cwd=`pwd` |
|---|
| 27 | if [ -z "$lname" ]; then |
|---|
| 28 | lname=`perl -e "\\\$temp = \"$cwd\"; \\\$temp =~ /\\\/([^\\\/]+)\\\/cron_scripts/; print \\\$1"` |
|---|
| 29 | fi |
|---|
| 30 | if [ -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 |
|---|
| 35 | fi |
|---|
| 36 | athrun scripts scripts-ssh "$lname" /usr/local/bin/cronload "$1" "$cwd" 2>/dev/null |
|---|
Note: See
TracBrowser
for help on using the repository browser.