init commit borg
This commit is contained in:
1 parent
36ed650628
commit
f2387d325c
14 files changed
+98
-292
No files matched your search
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
RUNFOLDER="{{ backup_run_folder }}";
|
||||
TARGETFOLDER="{{ backup_storage }}";
|
||||
REPOLOCATION="{{ backup_location }}";
|
||||
ARCHIVENAME="mailcow-$(date '+%s')";
|
||||
BORG_REPO_KEY=$(cat {{ backup_home }}/.borg.key);
|
||||
|
||||
cd $RUNFOLDER;
|
||||
MAILCOW_BACKUP_LOCATION="$TARGETFOLDER/" ./helper-scripts/backup_and_restore.sh backup all;
|
||||
LATESTBACKUP="$(ls -t $TARGETFOLDER | head -n 1)";
|
||||
|
||||
if [[ "$LATESTBACKUP" != *"mailcow"* ]];
|
||||
then
|
||||
echo "NOT MAILCOW! ABORT!";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
borg create -C lzma $REPOLOCATION::$ARCHIVENAME $TARGETFOLDER/$LATESTBACKUP;
|
||||
rm -rf $TARGETFOLDER/$LATESTBACKUP;
|
||||
@@ -0,0 +1 @@
|
||||
#!/bin/bash
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
|
||||
Reference in new issue
Block a user