Skip to content

Commit c7a7cd6

Browse files
committed
Add date keys
1 parent a2c5a23 commit c7a7cd6

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

export.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ if [ -f "$ROTATED_LOG_FILE" ]; then
2525
sleep 10
2626

2727
# Get the uploaded log file name
28-
TIMESTAMP=$(date +"%Y%m%dT%H00Z") # Cron runs on the hour, so we round to the hour
2928
HASH_SUFFIX=$(cksum "$ROTATED_LOG_FILE" | cut -d ' ' -f 1 | cut -c1-8)
30-
S3_KEY="${TIMESTAMP}_HASH${HASH_SUFFIX}_access.log.zst"
29+
S3_KEY="$(date +"%Y")/$(date +"%m")/$(date +"%d")/$(date +"%H")00_HASH${HASH_SUFFIX}_access.log.zst"
3130

3231
# Compress the rotated log before upload
3332
if ! zstd -19 -q -c "$ROTATED_LOG_FILE" > "$S3_KEY"; then

0 commit comments

Comments
 (0)