diff --git a/s3/s3_backup.sh b/s3/s3_backup.sh index dc38298..fef6213 100755 --- a/s3/s3_backup.sh +++ b/s3/s3_backup.sh @@ -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" @@ -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" @@ -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 \ No newline at end of file +fi