backup.sh updates etc

This commit is contained in:
Andrew Hurley 2022-12-26 15:29:50 +11:00
parent bde62426ae
commit 21e339a255
2 changed files with 7 additions and 6 deletions

View File

@ -1 +1 @@
14 4 * * * root /srv/backup/backup.sh -r "/srv/fsback" docker 2>&1 |tee /srv/fsback/$(date +%^a).log
14 4 * * * root /srv/backup/backup.sh -r "/srv/fsback" docker mailus 2>&1 |tee /srv/fsback/$(date +%^a).log

View File

@ -24,13 +24,14 @@ if [[ $# -lt 1 ]]; then
pexit "Error: missing project(s)"
fi
HN=$(hostname -f)
if [[ ! $HN =~ "." ]]; then
pexit "Error: fully quaififed hostname required (add to /etc/hosts - 127.0.0.11)"
if [[ -n $RSYNC ]]; then
HN=$(hostname -f)
if [[ ! $HN =~ "." ]]; then
pexit "Error: fully quaififed hostname required (add to /etc/hosts - 127.0.0.11)"
fi
printf "Hostname: ${HN}\n"
fi
printf "Hostname: ${HN}\n"
pushd /srv/backup || pexit "Error: changing to backup directory"
printf "Backup start: $(date)\n"
for PROJECT in $@; do