programme per cron stoppen und starten
Jürgen Leibner
Juergen.Leibner at t-online.de
Fri Nov 10 11:48:56 CET 2006
Am Freitag, 10. November 2006 11:31 schrieb Thomas Balsfulland:
> noch eine andere sache dazu.
> ich haette es gerne, das die sicherung erst startet wenn tobit und samba
> wirklich gestoppt sind. wie kann ich das in der art
>
> if [ $david_really_dead && $samba_really_dead ]; then
> tar cf /dev/nst0 /home /opt/david /etc /var/log;
>
> abfragen?
Mach dir ein script, ruf dieses script dann mit cron auf.
In dem script kannst du alles nötige sauber einbinden.
so wie:
...
echo "`date -u +%Y%m%d%M%S`: Domino wird gestoppt"
/etc/init.d/domino stop
wait
echo "`date -u +%Y%m%d%M%S`: Domino wurde gestoppt"
echo "`date -u +%Y%m%d%M%S`: $DOMDIR wird gesichert"
sleep 30
rsync -a --delete -v $DOMDIR $DOMBAKDIR
wait
echo "`date -u +%Y%m%d%M%S`: `du -sk $DOMBAKDIR` (in Kilobyte)"
echo "`date -u +%Y%m%d%M%S`: $DOMDIR wurde gesichert"
echo "`date -u +%Y%m%d%M%S`: $LOGDIR wird gesichert"
rsync -a --delete -v $LOGDIR $LOGBAKDIR
wait
echo "`date -u +%Y%m%d%M%S`: `du -sk $LOGBAKDIR` (in Kilobyte)"
echo "`date -u +%Y%m%d%M%S`: $LOGDIR wurde gesichert"
echo "`date -u +%Y%m%d%M%S`: Domino wird wieder gestartet"
/etc/init.d/domino start
wait
echo "`date -u +%Y%m%d%M%S`: Domino wurde wieder gestartet"
...
--
Mit freundlichen Grüßen / Best regards,
Jürgen Leibner
Anlagenlayout / Konstruktion
Hymmen GmbH Maschinen- und Anlagenbau
More information about the Linux
mailing list