aboutsummaryrefslogtreecommitdiff
path: root/backends/bup.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/bup.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/bup.sh')
-rw-r--r--backends/bup.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/backends/bup.sh b/backends/bup.sh
new file mode 100644
index 0000000..83e4e98
--- /dev/null
+++ b/backends/bup.sh
@@ -0,0 +1,23 @@
+function create_bup_backup() {
+ BACKUP_DIR="mc-backups"
+ CUR_BACK_DIR="mc-backups/$CUR_YEAR"
+
+ if [ ! -d "$CUR_BACK_DIR" ]; then
+ mkdir -p "$CUR_BACK_DIR"
+ fi
+
+ bup -d "$CUR_BACK_DIR" index "$WORLD_NAME"
+ status=$?
+ if [ $status -eq 1 ]; then
+ bup -d "$CUR_BACK_DIR" init
+ bup -d "$CUR_BACK_DIR" index "$WORLD_NAME"
+ fi
+
+ bup -d "$CUR_BACK_DIR" save -n "$BACKUP_NAME" "$WORLD_NAME"
+
+ echo "Backup using bup to $CUR_BACK_DIR is complete"
+}
+
+function ls_bup() {
+ bup -d "mc-backups/${CUR_YEAR}" ls "mc-sad-squad/$1"
+}