|
Last change
on this file since 2600 was
2313,
checked in by ezyang, 13 years ago
|
|
More robust error handling for cronload, by btidor.
|
-
Property svn:executable set to
*
|
|
File size:
300 bytes
|
| Line | |
|---|
| 1 | #!/bin/sh |
|---|
| 2 | |
|---|
| 3 | if [ -z "$1" ]; then |
|---|
| 4 | echo "ERROR: please specify a crontab file" >&2 |
|---|
| 5 | exit 1 |
|---|
| 6 | fi |
|---|
| 7 | |
|---|
| 8 | if [ -n "$2" ]; then |
|---|
| 9 | cd "$2" |
|---|
| 10 | fi |
|---|
| 11 | |
|---|
| 12 | if [ ! -f "$1" ]; then |
|---|
| 13 | echo "ERROR: file does not exist" >&2 |
|---|
| 14 | exit 1 |
|---|
| 15 | fi |
|---|
| 16 | |
|---|
| 17 | /bin/cat "$1" | /usr/bin/crontab - |
|---|
| 18 | |
|---|
| 19 | echo "New crontab for $USER:" |
|---|
| 20 | echo "" |
|---|
| 21 | /usr/bin/crontab -l |
|---|
Note: See
TracBrowser
for help on using the repository browser.