#!/bin/bash ################################################################################ # this script pipes commands to bconsole to start or cancel a bareos/bacula job # # Copyright (C) 2014 Michael Oehme # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version.# # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ################################################################################ ################################################################################ # Am Anfang werten wir die Kommandozeile aus und weißen die einzelnen Parameter # verschiedenen Variablen zu, welche wir im weiteren Verlauf des Skript noch # benötigen # Unter welchem Namen wurde diese Skript aufgerufen? MYSELF=$0 # Als erster Parameter muss die gewünschte Aktion (start oder stop) angegeben werden. ACTION=$1 # Als zweiter Parameter wird ein Bareos/Bacula-Job-Name erwartet JOBTORUN=$2 ################################################################################ ## Funktion für die Ausgabe der Synopsis (--help) function usage { echo "Usage: $MYSELF start|stop Job" echo "" echo "start|stop Should the given Job be started or stoped?" echo "Job Which bareos Job should be processed?" } ################################################################################ ## Funktion zum Start eine Bareos/Bacula-Jobs function start_job { echo "Job wird gestartet." /usr/sbin/bconsole <