diff --git a/chunker b/chunker index 8872018..7075179 100755 --- a/chunker +++ b/chunker @@ -49,8 +49,9 @@ do 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 | 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 diff --git a/pack-one b/pack-one index 63d40e7..b798e77 100755 --- a/pack-one +++ b/pack-one @@ -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 '[0-9]{14}_[a-f0-9]{8}$' | 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/" diff --git a/upload-one b/upload-one index aa3c2c4..b8f867c 100755 --- a/upload-one +++ b/upload-one @@ -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 '[0-9]{14}_[a-f0-9]{8}$' | 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/"