Bladeren bron

use uuids instead of %Y%m%d%H%M%S stamps

master
Katie Holly 5 jaren geleden
bovenliggende
commit
8c4d44189d
Geen bekende sleutel gevonden voor deze handtekening in de database GPG sleutel-ID: 3D3115D5D95856F
3 gewijzigde bestanden met toevoegingen van 7 en 7 verwijderingen
  1. +3
    -3
      chunker
  2. +2
    -2
      pack-one
  3. +2
    -2
      upload-one

+ 3
- 3
chunker Bestand weergeven

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


+ 2
- 2
pack-one Bestand weergeven

@@ -55,8 +55,8 @@ mayicontinue
ITEM=none
while [[ $ITEM = none ]]
do
possible_item=$( ls -1 "$PACKING_QUEUE_DIR/" | grep 201 | sort | head -n 1 )
if [[ $possible_item =~ 201 ]]
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 )
if test -n "${possible_item}"
then
echo "Trying to grab $possible_item"
if mv "$PACKING_QUEUE_DIR/$possible_item" "$PACKER_WORKING_CHUNKS_DIR/"


+ 2
- 2
upload-one Bestand weergeven

@@ -40,8 +40,8 @@ mayicontinue
ITEM=none
while [[ $ITEM = none ]]
do
possible_item=$( ls -1 "$UPLOAD_QUEUE_DIR" | grep 201 | sort | head -n 1 )
if [[ $possible_item =~ 201 ]]
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 )
if test -n "${possible_item}"
then
echo "Trying to grab $possible_item"
if mv "$UPLOAD_QUEUE_DIR/$possible_item" "$UPLOADER_WORKING_DIR/"


Laden…
Annuleren
Opslaan