First commit

This commit is contained in:
2020-09-05 17:02:29 +03:00
commit eaa50da074
3 changed files with 45 additions and 0 deletions

23
Bit-Frigger-Tarballer Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# Script to export the Bit Frigger's rootfs to a zstd tarball periodically
FINAL_DIR="/Red-Vol/Backups/Bit-Frigger/Tarball"
#Check for root permissions
if [[ $(whoami) != "root" ]]; then
echo "Please run this script as root or with sudo."
exit
fi
#Create directory if it does not exist
if [[ ! -d $FINAL_DIR ]]; then
mkdir $FINAL_DIR
fi
#Sync everything to it
echo "Gathering files for the tarball"
rsync -aHAXSv --progress --exclude=/dev --exclude=/Red-Vol --exclude=/proc --exclude=/rksmb "/" "$FINAL_DIR"
#And tar it with ZSTD
echo "Compressing tarball"
cd $FINAL_DIR
if [[ -f "$FINAL_DIR/Bit-Frigger.tar" ]]; then
tar rvfJ Bit-Frigger.tar.xz $FINAL_DIR
else
tar cvfJ Bit-Frigger.tar.xz $FINAL_DIR
fi