aboutsummaryrefslogtreecommitdiff
path: root/backends/tar.sh
diff options
context:
space:
mode:
authorGravatar TheMightyV <themightyv@protonmail.com> 2022-01-02 19:52:03 +0100
committerGravatar TheMightyV <themightyv@protonmail.com> 2022-01-02 19:52:03 +0100
commitcd32e794b00c04a5b969fd0292c7764e32e25863 (patch)
treef97a4689bc3cb15404b3dace03b9d26793d54d5b /backends/tar.sh
parentb0e2841205ed1f5ce8223c05e90258b30ea88879 (diff)
downloadminecraft-server-tools-cd32e794b00c04a5b969fd0292c7764e32e25863.tar.gz
converted spaces to tabs, moved tar and bup backends to backend directory
Diffstat (limited to 'backends/tar.sh')
-rw-r--r--backends/tar.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/backends/tar.sh b/backends/tar.sh
new file mode 100644
index 0000000..4d7ff36
--- /dev/null
+++ b/backends/tar.sh
@@ -0,0 +1,14 @@
+# TODO: Make default .tar with optional bup
+function tar_create_backup() {
+ ARCHNAME="backup/$WORLD_NAME-backup_`date +%d-%m-%y-%T`.tar.gz"
+ tar -czf "$ARCHNAME" "./$WORLD_NAME"
+
+ if [ ! $? -eq 0 ]
+ then
+ echo "TAR failed. No Backup created."
+ rm $ARCHNAME #remove (probably faulty) archive
+ return 1
+ else
+ echo $ARCHNAME created.
+ fi
+}