projects
/
mgsautils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ff0a58
)
backup.sh: Clean up junk if tar creation fails
author
MegaBrutal
<code+git@megabrutal.com>
Thu, 20 Aug 2015 05:31:48 +0000
(07:31 +0200)
committer
MegaBrutal
<code+git@megabrutal.com>
Thu, 20 Aug 2015 05:31:48 +0000
(07:31 +0200)
If the file system gets full during tar creation, and the junk files (SQL dumps, partial TAR) stay there, the file system is left with 100% usage.
This may have very unpleasant consequences, so it's best to simply remove those files.
modified: mysql/backup.sh
mysql/backup.sh
patch
|
blob
|
history
diff --git
a/mysql/backup.sh
b/mysql/backup.sh
index a68853f7b8a37a0ba18965f9731bf52c7318f3a9..5040f3fccad94eb4d52541dbd30811736b06d1a6 100755
(executable)
--- a/
mysql/backup.sh
+++ b/
mysql/backup.sh
@@
-49,5
+49,8
@@
then
done
else
echo "Failed to create archive: ${tarname}."
+ echo "Cleaning up..."
+ cd ${stordir}
+ rm -rv ${tempdir}
exit 1
fi