Last change
on this file since 2412 was
2313,
checked in by ezyang, 12 years ago
|
More robust error handling for cronload, by btidor.
|
-
Property svn:executable set to
*
|
File size:
300 bytes
|
Rev | Line | |
---|
[765] | 1 | #!/bin/sh |
---|
| 2 | |
---|
[2313] | 3 | if [ -z "$1" ]; then |
---|
| 4 | echo "ERROR: please specify a crontab file" >&2 |
---|
| 5 | exit 1 |
---|
| 6 | fi |
---|
| 7 | |
---|
[765] | 8 | if [ -n "$2" ]; then |
---|
| 9 | cd "$2" |
---|
| 10 | fi |
---|
| 11 | |
---|
[2313] | 12 | if [ ! -f "$1" ]; then |
---|
| 13 | echo "ERROR: file does not exist" >&2 |
---|
| 14 | exit 1 |
---|
| 15 | fi |
---|
| 16 | |
---|
[765] | 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.