@@ -36,41 +36,23 @@ source "scripts/include/common/cleanup.sh" || { echo "scripts/include/common/cle
3636source " scripts/include/common/duration_readable.sh" || { echo " scripts/include/common/duration_readable.sh not found" ; exit 1; }
3737source " scripts/include/common/load_persistence.sh" || { echo " scripts/include/common/load_persistence.sh not found" ; exit 1; }
3838source " scripts/include/restore/completion_stats.sh" || { echo " scripts/include/restore/completion_stats.sh not found" ; exit 1; }
39+ source " scripts/include/restore/process_volume.sh" || { echo " scripts/include/restore/process_volume.sh not found" ; exit 1; }
3940
4041BCS_TMPFILE=$( mktemp -u /tmp/baccus-XXXXXX)
4142trap Cleanup EXIT
4243
4344if [ " $BCS_COMPRESS " == " off" ] && [ -z " $BCS_PASSWORD " ]; then
4445 BCS_TARDIR=" $BCS_DEST "
4546else
47+ # Determine size for ramdisk based on the starting archive processed size
4648 if [ " $BCS_RAMDISK " == " on" ]; then
47- source=" $BCS_SOURCE " /" $BCS_BASENAME " .tar
4849 ramdisk_size_tmpdir=" $BCS_TMPFILE " .ramdisk_size
4950 mkdir " $ramdisk_size_tmpdir "
5051
51- if [ " $BCS_COMPRESS " == " on" ]; then
52- source=" $source " .gz
53- fi
54-
55- if [ -n " $BCS_PASSWORD " ]; then
56- if [ " $BCS_COMPRESS " == " on" ]; then
57- destination=" $ramdisk_size_tmpdir " /" $BCS_BASENAME " .tar.gz
58- else
59- destination=" $ramdisk_size_tmpdir " /" $BCS_BASENAME " .tar
60- fi
61- echo " $BCS_PASSWORD " | gpg -qd --batch --cipher-algo AES256 --compress-algo none --passphrase-fd 0 --no-mdc-warning -o " $destination " " $source " .gpg
62- source=" $destination "
63- fi
64-
65- if [ " $BCS_COMPRESS " == " on" ]; then
66- destination=" $ramdisk_size_tmpdir " /" $BCS_BASENAME " .tar
67- pigz -9cd " $source " > " $destination "
68- # gzip -9cd "$source" > "$destination"
69- source=" $destination "
70- fi
52+ source=" $BCS_SOURCE " /" $BCS_BASENAME " .tar
53+ Process_Volume " $BCS_BASENAME " .tar " $ramdisk_size_tmpdir " " $ramdisk_size_tmpdir "
7154
72- BCS_VOLUMESIZE=$( stat -c %s " $source " )
73- BCS_VOLUMESIZE=$(( BCS_VOLUMESIZE / 1024 ))
55+ BCS_VOLUMESIZE=$dest_actual_size
7456 rm -rf " $ramdisk_size_tmpdir "
7557
7658 ramdisk_size=0
9072 fi
9173fi
9274
93- # process first (possibly only) backup volume
75+ # Process first (possibly only) backup volume
9476echo " $BCS_BASENAME " .tar
95-
96- source=" $BCS_SOURCE " /" $BCS_BASENAME " .tar
9777timestamp=" $( date +%s) "
9878
99- if [ " $BCS_COMPRESS " == " on" ]; then
100- source=" $source " .gz
101- fi
102-
103- if [ -n " $BCS_PASSWORD " ]; then
104- if [ " $BCS_COMPRESS " == " on" ]; then
105- destination=" $BCS_DECRYPTDIR " /" $BCS_BASENAME " .tar.gz
106- else
107- destination=" $BCS_DECRYPTDIR " /" $BCS_BASENAME " .tar
108- fi
109- if [ -z " $source_actual " ]; then
110- source_actual=$( stat -c %s " $source " .gpg)
111- source_actual=$(( source_actual / 1024 ))
112- fi
113- echo " $BCS_PASSWORD " | gpg -qd --batch --cipher-algo AES256 --compress-algo none --passphrase-fd 0 --no-mdc-warning -o " $destination " " $source " .gpg
114- source=" $destination "
115- fi
116-
117- if [ " $BCS_COMPRESS " == " on" ]; then
118- destination=" $BCS_COMPRESDIR " /" $BCS_BASENAME " .tar
119- pigz -9cd " $source " > " $destination "
120- # gzip -9cd "$source" > "$destination"
121- if [ -z " $source_actual " ]; then
122- source_actual=$( stat -c %s " $source " )
123- source_actual=$(( source_actual / 1024 ))
124- fi
125- if [ -n " $BCS_PASSWORD " ]; then
126- rm -f " $source "
127- fi
128- source=" $destination "
129- fi
130-
131- if [ -z " $source_actual " ]; then
132- source_actual=$( stat -c %s " $source " )
133- source_actual=$(( source_actual / 1024 ))
134- fi
135-
136- dest_actual=$( stat -c %s " $source " )
137- dest_actual=$(( dest_actual / 1024 ))
79+ source=" $BCS_SOURCE " /" $BCS_BASENAME " .tar
80+ Process_Volume " $BCS_BASENAME " .tar " $BCS_DECRYPTDIR " " $BCS_COMPRESDIR "
13881
13982# Populate external data structure with starting values
14083export BCS_DATAFILE=" $BCS_TMPFILE " .runtime
14184runtime_data=$( jo bcs_source=" $BCS_SOURCE " \
14285 start_timestamp=" $timestamp " \
14386 last_timestamp=" $timestamp " \
144- source_size_running=$source_actual \
145- dest_size_running=$dest_actual \
87+ source_size_running=$source_actual_size \
88+ dest_size_running=$dest_actual_size \
14689 archive_volumes=1)
14790echo " $runtime_data " > " $BCS_DATAFILE "
14891
0 commit comments