Skip to content

Commit 859beb0

Browse files
author
Jarret Lavallee
committed
Cleanup the JSON files in the tarball
Prior to this commit, the JSON files were being backed up but only cleaned up every 90. This resulted in the same files being duplicated in each tarball for 90 days. This commit cleans up the json files to ensure that the tarballs only have a single days worth of data.
1 parent 8f231fa commit 859beb0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

files/metrics_tidy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ find "$metrics_directory" -type f -ctime +"$retention_days" -delete
5555
# The return code of a pipeline is the rightmost command, which means we trigger our trap if tar fails
5656
find "$metrics_directory" -type f -name "*json" | \
5757
tar --create --gzip --file "${metrics_directory}/${metrics_type}-$(date +%Y.%m.%d.%H.%M.%S).tar.gz" --files-from -
58+
59+
# Cleanup the backed up json files so that we do not duplicate files in the tarballs.
60+
find "$metrics_directory" -type f -name "*json" -delete

0 commit comments

Comments
 (0)