Skip to content

Commit 6b3f282

Browse files
committed
Upload only .db files from the main directory
1 parent 28e0e20 commit 6b3f282

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

images/taginfo/start.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,15 @@ process_data() {
4747
chronology/update.sh $DATADIR
4848
./update_all.sh $DATADIR
4949
# Move database files from subdirectories to main data directory
50-
aws s3 sync $DATADIR/ s3://$AWS_S3_BUCKET/taginfo/$ENVIRONMENT/ --exclude "*" --include "*.db"
50+
find $DATADIR -mindepth 2 -name "*.db" -type f -exec mv {} $DATADIR/ \; 2>/dev/null || true
51+
# Upload only .db files from the main directory (not subdirectories)
52+
if ! aws s3 ls "s3://$AWS_S3_BUCKET/taginfo/$ENVIRONMENT" 2>&1 | grep -q 'An error occurred'; then
53+
for db_file in $DATADIR/*.db; do
54+
if [ -f "$db_file" ]; then
55+
aws s3 cp "$db_file" "s3://$AWS_S3_BUCKET/taginfo/$ENVIRONMENT/$(basename "$db_file")"
56+
fi
57+
done
58+
fi
5159
}
5260

5361
# Compress files to download

0 commit comments

Comments
 (0)