Commit 6776efe7 authored by Fjen Undso's avatar Fjen Undso
Browse files

unify error messages

parent 7a4bf5d7
......@@ -48,7 +48,7 @@ fail() {
execftp() {
lftp -u $FTPUSER,$FTPPASS $FTPTYPE://$FTPHOST -e "$1"
[ $? -ge 1 ] \
&& fail "ftp command failed: $1"
&& fail "Error: ftp command failed: $1"
}
### Check prerequisites
......@@ -61,7 +61,7 @@ done
### Check local directory
if [ ! -d "$LOCALDIR" ]; then
mkdir -p "$LOCALDIR" \
|| fail "Failed to create $LOCALDIR"
|| fail "Error: failed to create $LOCALDIR"
fi
### Delete local old backups
......@@ -76,10 +76,10 @@ echo "### MySQL Backup..."
date=$(date +"%Y%m%d-%H%M%S")
backupdir="$LOCALDIR/$date"
mkdir "$backupdir" \
|| fail "Failed to create $backupdir"
|| fail "Error: failed to create $backupdir"
mydumper -u "$MYUSER" -p "$MYPASS" -h "$MYHOST" --regex "$EXLUDEDBS" -o "$backupdir"
[ $? -ge 1 ] \
&& fail "mydumper failed"
&& fail "Error: mydumper failed"
### Compression
echo "### Compression..."
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment