Skip to content

Instantly share code, notes, and snippets.

@phunehehe phunehehe/amanda-retry.sh
Last active Dec 28, 2015

Embed
What would you like to do?
#!/bin/bash
set -e
monthday="$(date +%-d)"
weekday="$(date +%w)"
if [[ "$monthday" -eq 1 ]]
then
config=monthly
elif [[ "$weekday" -eq 0 ]]
then
config=weekly
else
config=daily
fi
string=$(
sudo -u amandabackup amreport $config |
grep FAILED |
awk '{print $1}' |
sort -u |
while read host
do
echo -n " .$host "
done
)
[[ "$string" = "" ]] && exit 0
sudo -u amandabackup amdump $config $string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.