fixed grammar & output of script

:
This commit is contained in:
Tristan Ancelet 2024-06-06 17:37:05 -05:00
parent ef2bb4f28a
commit 4b409db718

View File

@ -2,7 +2,7 @@
###############################################################################
# do-daily-backup.sh #
# do-daily-btrfs-snapshot.sh #
###############################################################################
# This script is my attempt at replicating the same function that timeshift #
# performs. This is a very simplified script to handle automated btrfs #
@ -26,9 +26,9 @@
# BEGIN: Variables
## Reusable vars
DATE=`date +%Y-%m-%d`
DATE=$(date +%Y-%m-%d)
### Getting the name of the script (as it will be the first thing passed to bash when executing)
SCRIPT=`basename $0`
SCRIPT=$(basename $0)
BACKUP_DIR=/.backups
### Setting dir to house log files
LOG_DIR=/var/log/$SCRIPT
@ -57,7 +57,7 @@ function handle_logs() {
cd $LOG_DIR
echo "Began Handling logs at: $(date)"
local ARCHIVE_FILE=archive.tar.gz
local ARCHIVE_FILE_UNZIPED=${ARCHIVE_FILE%.gz}
local ARCHIVE_FILE_UNZIPPED=${ARCHIVE_FILE%.gz}
if [[ -f $ARCHIVE_FILE ]]; then
## Decompressing archive in case it exists
@ -82,11 +82,11 @@ function handle_logs() {
echo "Adding archived logs to archive"
## Updating archive
tar uvf $ARCHIVE_FILE_UNZIPED ${FILES_TO_ARCHIVE[@]}
tar uvf $ARCHIVE_FILE_UNZIPPED ${FILES_TO_ARCHIVE[@]}
## Compressing Archive
echo "Compressing Archive"
gzip $ARCHIVE_FILE_UNZIPED
gzip $ARCHIVE_FILE_UNZIPPED
## Removing archived logs
echo "Removing archived files"
@ -154,7 +154,7 @@ for SUBVOL_INFO in ${SUBVOLS[@]}; do
if [[ ! -d $SNAPSHOT ]]; then
/usr/sbin/btrfs subvol snapshot -r $DIR $SNAPSHOT
else
echo "$SNAPSHOT already existed. Not backing up"
echo "$SNAPSHOT already existed. Not doing a snapshot"
fi
done