programme per cron stoppen und starten

hawkeye at t-harding.de hawkeye at t-harding.de
Fri Nov 10 10:10:12 CET 2006


Thomas Balsfulland schrieb:

>hallo zusammen,
>
>ich habe probleme programme per cron zu stoppen oder starten.
>ich moechte gerne
>
>   /etc/init.d/DvISEctl stop   (tobit david)    oder
>   /etc/init.d/samba stop
>
>per cron ausfuehren, was aber scheitert. allerdings starte ich aus cron
>ein 5-zeiler, in dem dann unter anderem die oben genannten zeilen stehen
>cron schickt mir eine mail, in der steht:
>
>  
>
>>stty: Standardeingabe: Das Argument ist ung
>>
>>stty: Standardeingabe: Das Argument ist ung
>>stopping DvISE module postman ...
>>^[[C^[[10D^[[1A.....done^O
>>stty: Standardeingabe: Das Argument ist ung
>>stopping DvISE module dvgrab ...
>>^[[C^[[10D^[[1A.....done^O
>>stty: Standardeingabe: Das Argument ist ung
>>stty: Standardeingabe: Das Argument ist ung
>>stopping DvISE module replica ...
>>^[[C^[[10D^[[1A.....done^O
>>stty: Standardeingabe: Das Argument ist ung
>>stopping DvISE module webbox ...
>>^[[C^[[10D^[[1A.....done^O
>>stty: Standardeingabe: Das Argument ist ung
>>stty: Standardeingabe: Das Argument ist ung
>>stty: Standardeingabe: Das Argument ist ung
>>stopping DvISE module sl ...
>>^[[C^[[10D^[[1A.....done^O
>>stty: Standardeingabe: Das Argument ist ung
>>    
>>
>
>oder bei samba:
>
>  
>
>>Stopping Samba daemons: /etc/init.d/samba: line 39: start-stop-daemon:
>>command not found
>>nmbd/etc/init.d/samba: line 51: start-stop-daemon: command not found
>> smbd.
>>Starting Samba daemons: nmbd/etc/init.d/samba: line 27:
>>start-stop-daemon: command not found
>> smbd/etc/init.d/samba: line 31: start-stop-daemon: command not found
>>    
>>
>
>
>und so stoppen die programme nicht.
>hintergrund: bevor ich eine datensicherung auf band starte, sollte samba
>und tobit gestoppt werden. so sieht dann mein 5-zeiler aus:
>
>#!/bin/sh
>  mt -f /dev/nst0 status | grep ONLINE &> /dev/null
>
>if [ $? -eq 0 ]; then
>  /etc/init.d/samba stop;
>  /etc/init.d/DvISEctl stop;
>
>  tar cf /dev/nst0 /home /opt/david /etc /var/log;
>
>  /etc/init.d/DvISEctl start;
>  /etc/init.d/samba start;
>else
>  echo "Es ist kein Band im Laufwerk";
>  exit 1;
>fi
>
>
>hat jemand einen tip was ich falsch mache?
>
>
>gruss
>  thomas
>
>  
>
meines erachtens liegt das nicht am enviroment sondern dadran das der 
script "festverdratete" pfade hat
also z.b. /usr/sbin/ps im system selbst liegt ps aber in /sbin
der script von david wertet keine errorcodes aus und nimmt an alle 
befehle sind erfolgreich ausgeführt deswegen wirft er "......done" aus
was auch sein kann ist das der benutzer bei dem der "5zeiler" in der 
crontab steht keine berechtigung hat auf superuserprogramme

hoffe ich konnte helfen

mfg
Thomas



More information about the Linux mailing list