Skip to content

Commit

Permalink
Fix backup
Browse files Browse the repository at this point in the history
  • Loading branch information
mas-4 committed May 29, 2024
1 parent ed7dfab commit 6831640
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ DATE=$(date +%Y-%m-%d)

# Define the source and destination paths
SOURCE_FILE="/home/maudlin/maudlin2/data/data.db"
INTERMED_FILE="${MOUNT_POINT}/data-$DATE.db"
INTERMED_FILE = "data-$DATE.db"
TARGET_FILE="${MOUNT_POINT}/data-$DATE.db.gz"

# Copy and compress the database file with a timestamp
echo "Backing up the database file..."
# Copy the file to the destination and compress it
cp ${SOURCE_FILE} ${INTERMED_FILE} && gzip -f ${INTERMED_FILE}
cp ${SOURCE_FILE} ${INTERMED_FILE}
gzip -f ${INTERMED_FILE}
cp ${INTERMED_FILE}.gz ${TARGET_FILE}

# Check if the backup was successful
if [ $? -eq 0 ]; then
Expand Down

0 comments on commit 6831640

Please sign in to comment.