PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Sh Skript



MrIch
13-07-2001, 04:51
Folgendes Problem, ich habe mir ein "Skript" geschrieben, welches die T-DSL Verbindung aufbaut, Inhalt:
#/bin/sh
if ... then ....
rcpppoed start
Wenn ich dieses Skript aus der Konsole als root ausführen, dann baut er eine Vebindung auf, wenn ich es aber als root in die crontab baue, dann führt er das Skript zwar aus, baut aber keine Verbindung auf!

Wieso funzt es manuel und über die crontab nicht?

Matzetronic
13-07-2001, 09:44
1. poste mal deine /etc/crontab.
2. zum probieren fehlerausgaben mal nicht umleiten (damit eintrag in der messages bzw. mail an root erfolgt)
3. fehlermeldungen bzw. mail an root posten

mögliche fehler:
1. verzeichnispfade
2. zugriffsrechte...

matze

MrIch
13-07-2001, 16:11
cat /etc/crontab
SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
MAILTO=root

#-* * * * * root test -x /usr/sbin/atrun && /usr/sbin/atrun
0 21 * * * root test -x /usr/sbin/faxqclean && /usr/sbin/faxqclean
5 22 * * * root test -x /usr/sbin/texpire && /usr/sbin/texpire
25 23 * * * root test -e /usr/sbin/faxcron && sh /usr/sbin/faxcron | mail FaxMaster

#
# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
#
-*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons
0 0 * * * root rm -f /var/spool/cron/lastrun/cron.daily
0 0 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly
0 0 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly

Das Probleme ist, dass es keine Fehlermeldung ausgibt, ...

================================

/bin/sh
#

if test /usr/local/httpd/htdocs/start.dsl -nt /usr/local/httpd/htdocs/stop.dsl; then
rcpppoed start >/root/dial.log
echo "DSL start">>/root/dial.log
fi

if test /usr/local/httpd/htdocs/start.dsl -ot /usr/local/httpd/htdocs/stop.dsl; then
rcpppoed stop >/root/dial.log
echo "DSL stop">>/root/dial.log
fi


Das ist das Skript!

mustafaB
13-07-2001, 22:53
Hallo nur eine kleine Vermutung, hatte aber auch mal ein problem damit.

Gib bei den Kron Jobs immer den VOLLEN Pfad an


also

/bin/ping
anstatt nur
ping

bei allen befehlen,
hoffe das hilft...

gruss
Musa

Matzetronic
13-07-2001, 23:37
ähm, vielleicht bin ich ja blind, aber in deiner crontab seh ich nix von deinem script. :confused:

matze

MrIch
13-07-2001, 23:55
root@ls001:/home/phil > crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.2451 installed on Wed Jul 11 21:31:54 2001)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
* * * * * /root/dial.sh
root@ls001:/home/phil >

Nun habe ich den vollen Pfad angegeben und er macht es!

Danke für den Tip, ich dachte das hätte ich schon ausprobiert gehabt, ...

aber hauptsache es funzt!!!!