Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
busybot: store md5 as part of filename
Browse files Browse the repository at this point in the history
Signed-off-by: Zuhair AlSader <zuhair@koor.tech>
  • Loading branch information
zalsader committed Nov 14, 2023
1 parent 10fb017 commit 0d545d3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions busybot/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ metadata:
name: busybot
namespace: busybot
spec:
schedule: "*/2 * * * *"
schedule: "* * * * *"
successfulJobsHistoryLimit: 5
failedJobsHistoryLimit: 5
concurrencyPolicy: Forbid
Expand Down Expand Up @@ -61,16 +61,17 @@ spec:
# Read $COUNT random files from store and calculate md5
ls $STORE | shuf -n $COUNT | while read file
do
echo Reading $file
md5sum $STORE/$file
done
# Write $COUNT random files from store
shuf -n $COUNT -i 0-99 | while read file
do
filename=$(printf "%02d" $file)
dd if=/dev/urandom of=/tmp/file bs=$SIZE count=1
md5=$(md5sum /tmp/file | awk '{ print $1 }')
filename=$(printf "%02d-%s" $file $md5)
echo Writing $filename
dd if=/dev/urandom of=$STORE/$filename bs=$SIZE count=1
mv /tmp/file $STORE/$filename
done
# Delete $DEL_COUNT random files from store
Expand Down

0 comments on commit 0d545d3

Please sign in to comment.