Skip to content
Snippets Groups Projects
Commit 4f752352 authored by Timothy ODonnell's avatar Timothy ODonnell Committed by Tim O'Donnell
Browse files

parts

parent b82888ef
No related branches found
No related tags found
No related merge requests found
...@@ -24,8 +24,9 @@ else ...@@ -24,8 +24,9 @@ else
fi fi
# Send stdout and stderr to a logfile included with the archive. # Send stdout and stderr to a logfile included with the archive.
exec > >(tee -ia "$SCRATCH_DIR/$DOWNLOAD_NAME/LOG.txt") LOG="$SCRATCH_DIR/$DOWNLOAD_NAME/LOG.$(date +%s).txt"
exec 2> >(tee -ia "$SCRATCH_DIR/$DOWNLOAD_NAME/LOG.txt" >&2) exec > >(tee -ia "$LOG")
exec 2> >(tee -ia "$LOG" >&2)
# Log some environment info # Log some environment info
echo "Invocation: $0 $@" echo "Invocation: $0 $@"
...@@ -71,7 +72,21 @@ do ...@@ -71,7 +72,21 @@ do
done done
cp $SCRIPT_ABSOLUTE_PATH . cp $SCRIPT_ABSOLUTE_PATH .
bzip2 LOG.txt bzip2 -f "$LOG"
for i in $(ls LOG-worker.*.txt) ; do bzip2 $i ; done for i in $(ls LOG-worker.*.txt) ; do bzip2 -f $i ; done
tar -cjf "../${DOWNLOAD_NAME}.tar.bz2" * RESULT="$SCRATCH_DIR/${DOWNLOAD_NAME}.$(date +%Y%m%d).tar.bz2"
echo "Created archive: $SCRATCH_DIR/${DOWNLOAD_NAME}.tar.bz2" tar -cjf "$RESULT" *
echo "Created archive: $RESULT"
# Split into <2GB chunks for GitHub
PARTS="${RESULT}.part."
# Check for pre-existing part files and rename them.
for i in $(ls "${PARTS}"* )
do
DEST="${i}.OLD.$(date +%s)"
echo "WARNING: already exists: $i . Moving to $DEST"
mv $i $DEST
done
split -b 2000M "$RESULT" "$PARTS"
echo "Split into parts:"
ls -lh "${PARTS}"*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment