Last active
September 28, 2017 00:03
-
-
Save ntrogers/34775fda411edc1b108c0cb1f69608f8 to your computer and use it in GitHub Desktop.
[Bacula] #Bacula #nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clients=`mysql -e'select Name from Client ORDER BY Name ASC;' bacula | tail -n+2` | |
for client in `echo $clients` | |
do | |
echo "prune files client=${client} yes" | bconsole | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobIds=`echo 'status dir running' | bconsole | fgrep 'is waiting' | awk '{print $1}'` | |
for i in $jobIds | |
do | |
if [ -z `echo "$i" | grep '^[0-9]\+$'` ] | |
then | |
echo "Error: job ID $i is not a number!" | |
else | |
echo "Killing waiting Bacula job $i" | |
echo "cancel jobid=$i" | bconsole | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment