Compare commits

..

No commits in common. "3347cb35e6338034ba9d3dabf30432f02f78c7da" and "e978b6a36e2dc89a12fd935689c62cac664bf25c" have entirely different histories.

4 changed files with 19 additions and 25 deletions

View File

@ -4,7 +4,7 @@ function backup () {
#--stats = show stats at end #--stats = show stats at end
#--progress = show each file being processed #--progress = show each file being processed
nice -n 19 borg create --compression auto,zstd,9 --exclude-from=./exclude $1 "$2" nice -n 19 borg create --compression auto,zstd,9 --exclude-from=./exclude $*
} }
function backupNoCompression () { function backupNoCompression () {
@ -13,7 +13,7 @@ function backupNoCompression () {
#--stats = show stats at end #--stats = show stats at end
#--progress = show each file being processed #--progress = show each file being processed
nice -n 19 borg create --compression none --exclude-from=./exclude $1 "$2" nice -n 19 borg create --compression none --exclude-from=./exclude $*
} }
function checkBackup() { function checkBackup() {
@ -110,13 +110,14 @@ backupNoCompression "$HDPath/Videos::$YEARMONTH" "/run/media/bruno/Multimedia/Vi
checkBackup "$HDPath/Videos/" checkBackup "$HDPath/Videos/"
echo -e "\e[97m`date +%r` - Copying Virtual Machines folder (7/7)...\e[39m" echo -e "\e[97m`date +%r` - Copying Virtual Machines folder (7/7)...\e[39m"
backup "$HDPath/VirtualMachines::$YEARMONTH-2" "/run/media/bruno/Multimedia/Virtual Machines" || echo "" backup "$HDPath/VirtualMachines::$YEARMONTH" "/run/media/bruno/Multimedia/Virtual\ Machines" || echo ""
checkBackup "$HDPath/VirtualMachines/" checkBackup "$HDPath/VirtualMachines/"
# Show result # Show result
echo -e "\e[97m`date +%r` - Backup finished. Please, verify your log files.\e[39m" echo -e "\e[97m`date +%r` - Backup finished. Please, verify your log files.\e[39m"
echo "$ActiveDisk" > .lastDisk echo "$ActiveDisk" > .lastDisk
echo "$ActiveBackupSet" > ".lastBackupSetDisk_$lastDisk"
kdialog --title "Backup Complete" --msgbox "Backup finished successfully" kdialog --title "Backup Complete" --msgbox "Backup finished successfully"
echo echo

View File

@ -1,4 +0,0 @@
doas rm /etc/systemd/system/$1
doas cp -f $1 /etc/systemd/system/
doas systemctl daemon-reload
doas systemctl status $1

View File

@ -6,11 +6,11 @@ if screen -list | grep -q "Minecraft"; then
fi fi
if [[ -z $publicBackup && -z $otherBackup ]] ; then if [[ -z $publicBackup && -z $otherBackup ]] ; then
echo "Minecraft is not running. Exiting..." echo "Entrei"
exit 0 exit 1
fi fi
BACKUPDIR="/home/bruno/Backups/Minecraft-borg" BACKUPDIR="/home/bruno/Backups/zBackup-Minecraft/backups"
SERVERDIR="/home/bruno/Apps/Minecraft" SERVERDIR="/home/bruno/Apps/Minecraft"
PUBLICDIR="$SERVERDIR/BedrockServer_Public_19132" PUBLICDIR="$SERVERDIR/BedrockServer_Public_19132"
SURVIVALDIR="$SERVERDIR/BedrockServer_Survival_19132" SURVIVALDIR="$SERVERDIR/BedrockServer_Survival_19132"
@ -18,6 +18,7 @@ CREATIVEDIR="$SERVERDIR/BedrockServer_Creative_19134"
LogFile="log.txt" LogFile="log.txt"
BACKUPDATE=$(date +"%Y-%m-%d_%H-%M-%S") BACKUPDATE=$(date +"%Y-%m-%d_%H-%M-%S")
mkdir "$BACKUPDIR/$BACKUPDATE"
alias run='screen -S Minecraft -X' alias run='screen -S Minecraft -X'
alias runSurvival='run at Survival stuff' alias runSurvival='run at Survival stuff'
@ -48,7 +49,7 @@ if [[ $publicBackup ]]; then
runPublic "say ^usave query\n" runPublic "say ^usave query\n"
finishedPublic=$(tail -n 4 "$PUBLICDIR/$LogFile") finishedPublic=$(tail -n 4 "$PUBLICDIR/$LogFile")
done done
borg create --stats --compression auto,zstd,9 "$BACKUPDIR::$BACKUPDATE-MncftPublic" "$PUBLICDIR" /bin/tar c "$PUBLICDIR/worlds" | zbackup --non-encrypted backup "$BACKUPDIR/$BACKUPDATE/MncftPublic"
runPublic "say ^usave resume\n" runPublic "say ^usave resume\n"
fi fi
@ -84,9 +85,9 @@ if [[ $otherBackup ]]; then
finishedSurvival=$(tail -n 4 "$SURVIVALDIR/$LogFile") finishedSurvival=$(tail -n 4 "$SURVIVALDIR/$LogFile")
done done
borg create --stats --compression auto,zstd,9 "$BACKUPDIR::$BACKUPDATE-MncftSurvival" "$SURVIVALDIR" /bin/tar c "$SURVIVALDIR/worlds" | zbackup --non-encrypted backup "$BACKUPDIR/$BACKUPDATE/Survival"
borg create --stats --compression auto,zstd,9 "$BACKUPDIR::$BACKUPDATE-MncftCreative" "$CREATIVEDIR" /bin/tar c "$CREATIVEDIR/worlds" | zbackup --non-encrypted backup "$BACKUPDIR/$BACKUPDATE/Creative"
runSurvival "^u" runSurvival "^u"
runSurvival "save resume\n" runSurvival "save resume\n"
fi fi
borg prune --keep-within=3d --keep-hourly=96 --keep-weekly=8 --keep-monthly=6 "$BACKUPDIR"

View File

@ -15,24 +15,20 @@ tmux splitw -h -t pmovase:0.1
terminator -T PMova-se -b --geometry=627x927 -x tmux a -t pmovase & terminator -T PMova-se -b --geometry=627x927 -x tmux a -t pmovase &
tmux resize-pane -t pmovase:0.0 -U 35 tmux resize-pane -t pmovase:0.0 -U 30
tmux resize-pane -t pmovase:0.1 -U 10 tmux resize-pane -t pmovase:0.1 -U 15
tmux resize-pane -t pmovase:0.4 -U 10 tmux resize-pane -t pmovase:0.4 -U 10
tmux send -t pmovase:0.0 $'npm run vagrant; npm run watch\n' tmux send -t pmovase:0.0 $'npm run vagrant; npm run watch\n'
tmux send -t pmovase:0.2 $'clear; echo Waiting for vagrant to start...\n' tmux send -t pmovase:0.2 $'clear; Waiting for vagrant to start...\n'
while [[ -z $(ping projetomovase.test -c 1 | grep "time=") ]] ; do while [[ -z $(ping projetomovase.test -c 1 | grep "time=") ]] ; do
sleep 5 sleep 1
done done
sleep 10
tmux send -t pmovase:0.1 $'npm run cypress:open\n'
tmux send -t pmovase:0.1 $'npm run test-watch\n' tmux send -t pmovase:0.1 $'npm run test-watch\n'
tmux send -t pmovase:0.2 $'^u' tmux send -t pmovase:0.2 $'^u'
tmux send -t pmovase:0.2 $'npm run test-php-watch\n' tmux send -t pmovase:0.2 $'phpunit-watcher watch\n'
tmux send -t pmovase:0.3 $'npm run ssh\n' tmux send -t pmovase:0.3 $'ssh homestead -t \"cd code;alias clear='clear; figlet Vagrant';clear;bash --login\"\n'
tmux send -t pmovase:0.4 $'alias clear=\'clear;figlet PMova-se\';clear\n' tmux send -t pmovase:0.4 $'alias clear='clear;figlet PMova-se';clear\n'
/bin/vscodium &
/home/bruno/Apps/firefox/firefox-bin &