Skip to content

Commit

Permalink
Update s3_backup.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz authored Jan 9, 2025
1 parent 6e2e947 commit 5167214
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions s3/s3_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ tmp_pass="/root/pass.txt"
# Create the unencrypted copy directory
log "Clearing old unencrypted data"

find "$unencrypted_copy/" -type f -delete
log "Creating unencrypted directory"
mkdir -p "$unencrypted_copy"
find "$unencrypted_copy/" -type f -delete

log "Copy data"

cp --verbose -a "$basedir/." "$unencrypted_copy"
Expand All @@ -27,10 +28,11 @@ log "Removing duplicate files"
fdupes -qdiN -r "$unencrypted_copy"
log "Clearing old encrypted data"

find "$baseEncryptDir/" -type f -delete
# Create the encrypted backup directory
log "Creating encrypted backup directory"
mkdir -p "$baseEncryptDir"
find "$baseEncryptDir/" -type f -delete

# Write the encryption password to a file
log "Writing encryption password to file"
touch "$tmp_pass"
Expand Down Expand Up @@ -94,4 +96,4 @@ done
# Send a notification using the s3_notify_uptime_kuma.sh script
if ! /s3_notify_uptime_kuma.sh; then
log "Failed to send notification"
fi
fi

0 comments on commit 5167214

Please sign in to comment.