Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Fjen Undso
borgcron
Commits
9682f12b
Commit
9682f12b
authored
Feb 24, 2021
by
Fjen Undso
Browse files
style fixes
parent
e3651d08
Changes
1
Hide whitespace changes
Inline
Side-by-side
borgbackup.sh
View file @
9682f12b
...
@@ -10,7 +10,7 @@ source ./borgbackup.config.sh
...
@@ -10,7 +10,7 @@ source ./borgbackup.config.sh
# borg backup
# borg backup
info
"Starting backup"
info
"Starting backup"
TMPFILE1
=
"
$(
temp
file
)
"
TMPFILE1
=
"
$(
mk
temp
)
"
borg create
\
borg create
\
--verbose
\
--verbose
\
--stats
\
--stats
\
...
@@ -27,7 +27,7 @@ backup_exit=$?
...
@@ -27,7 +27,7 @@ backup_exit=$?
# limit prune's operation to this machine's archives and not apply to
# limit prune's operation to this machine's archives and not apply to
# other machine's archives also.
# other machine's archives also.
info
"Pruning repository"
info
"Pruning repository"
TMPFILE2
=
"
$(
temp
file
)
"
TMPFILE2
=
"
$(
mk
temp
)
"
borg prune
\
borg prune
\
--prefix
'{hostname}-'
\
--prefix
'{hostname}-'
\
--verbose
\
--verbose
\
...
@@ -52,12 +52,14 @@ global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit ))
...
@@ -52,12 +52,14 @@ global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit ))
if
[
$global_exit
!=
0
]
;
then
if
[
$global_exit
!=
0
]
;
then
/usr/bin/logger
-t
backup
"Exited abnormally with [
$backup_exit
][
$prune_exit
]"
/usr/bin/logger
-t
backup
"Exited abnormally with [
$backup_exit
][
$prune_exit
]"
MAIL
=
"# borg create:
\n
"
MAIL
=
"# borg create:
\n
"
MAIL+
=
"
$(
cat
'$TMPFILE1'
)
\n\n
"
MAIL+
=
$(
cat
"
$TMPFILE1
"
)
MAIL+
=
"
\n\n
"
MAIL+
=
"# borg prune:
\n
"
MAIL+
=
"# borg prune:
\n
"
MAIL+
=
"
$(
cat
'$TMPFILE2'
)
\n\n
"
MAIL+
=
$(
cat
"
$TMPFILE2
"
)
MAIL+
=
"
\n\n
"
MAIL+
=
"# borg list:
\n
"
MAIL+
=
"# borg list:
\n
"
MAIL+
=
"
$(
borg list
)
\n\n
"
MAIL+
=
"
$(
borg list
)
\n\n
"
MAIL+
=
"Cheers,
\n
$HOSTNAME
"
MAIL+
=
"Cheers,
\n
$HOSTNAME
"
echo
-e
"
$MAIL
"
| mail
-a
"Content-Type: text/plain; charset=UTF-8"
-s
"
$HOSTNAME
: borgbackup failed!"
"
$ADMINMAIL
"
echo
-e
"
$MAIL
"
| mail
-a
"Content-Type: text/plain; charset=UTF-8"
-s
"
$HOSTNAME
: borgbackup failed!"
"
$ADMINMAIL
"
fi
fi
rm
-f
"
$TMPFILE1
"
"
$TMPFILE2
"
rm
-f
"
$TMPFILE1
"
"
$TMPFILE2
"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment