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

Commit 0d545d3

Browse files
author
Zuhair AlSader
committed
busybot: store md5 as part of filename
Signed-off-by: Zuhair AlSader <[email protected]>
1 parent 10fb017 commit 0d545d3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

busybot/deploy.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ metadata:
2222
name: busybot
2323
namespace: busybot
2424
spec:
25-
schedule: "*/2 * * * *"
25+
schedule: "* * * * *"
2626
successfulJobsHistoryLimit: 5
2727
failedJobsHistoryLimit: 5
2828
concurrencyPolicy: Forbid
@@ -61,16 +61,17 @@ spec:
6161
# Read $COUNT random files from store and calculate md5
6262
ls $STORE | shuf -n $COUNT | while read file
6363
do
64-
echo Reading $file
6564
md5sum $STORE/$file
6665
done
6766
6867
# Write $COUNT random files from store
6968
shuf -n $COUNT -i 0-99 | while read file
7069
do
71-
filename=$(printf "%02d" $file)
70+
dd if=/dev/urandom of=/tmp/file bs=$SIZE count=1
71+
md5=$(md5sum /tmp/file | awk '{ print $1 }')
72+
filename=$(printf "%02d-%s" $file $md5)
7273
echo Writing $filename
73-
dd if=/dev/urandom of=$STORE/$filename bs=$SIZE count=1
74+
mv /tmp/file $STORE/$filename
7475
done
7576
7677
# Delete $DEL_COUNT random files from store

0 commit comments

Comments
 (0)