Browse Source

Use timestamp and first 8 characters of UUIDv4 hex

master
Katie Holly 5 years ago
parent
commit
f88d14b2a2
No known key found for this signature in database GPG Key ID: 3D3115D5D95856F
3 changed files with 6 additions and 5 deletions
  1. +4
    -3
      chunker
  2. +1
    -1
      pack-one
  3. +1
    -1
      upload-one

+ 4
- 3
chunker View File

@@ -48,9 +48,10 @@ do
# rename it to archive-XXXXX and start a new current/
if [[ $cur_size -gt $BYTES_PER_CHUNK ]]
then
uuid=$(cat /proc/sys/kernel/random/uuid)
echo "Current archive is full, moving to ${uuid}."
mv "$CHUNKER_WORKING_DIR/current" "$PACKING_QUEUE_DIR/${uuid}"
timestamp=$( date +'%Y%m%d%H%M%S' )
uuid=$(cat /proc/sys/kernel/random/uuid | cut -d- -f1)
echo "Current archive is full, moving to ${timestamp}_${uuid}."
mv "$CHUNKER_WORKING_DIR/current" "$PACKING_QUEUE_DIR/${timestamp}_${uuid}"
cur_size=0
sleep 3
fi


+ 1
- 1
pack-one View File

@@ -55,7 +55,7 @@ mayicontinue
ITEM=none
while [[ $ITEM = none ]]
do
possible_item=$( ls -1 "$PACKING_QUEUE_DIR/" | grep -E '_[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}$' | sort | head -n 1 )
possible_item=$( ls -1 "$PACKING_QUEUE_DIR/" | grep -E '[0-9]{14}_[a-f0-9]{8}$' | sort | head -n 1 )
if test -n "${possible_item}"
then
echo "Trying to grab $possible_item"


+ 1
- 1
upload-one View File

@@ -40,7 +40,7 @@ mayicontinue
ITEM=none
while [[ $ITEM = none ]]
do
possible_item=$( ls -1 "$UPLOAD_QUEUE_DIR" | grep -E '_[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}$' | sort | head -n 1 )
possible_item=$( ls -1 "$UPLOAD_QUEUE_DIR" | grep -E '[0-9]{14}_[a-f0-9]{8}$' | sort | head -n 1 )
if test -n "${possible_item}"
then
echo "Trying to grab $possible_item"


Loading…
Cancel
Save