updates needed after local storage infrastructure change

This commit is contained in:
2016-11-19 00:28:24 -08:00
parent 49c61eb985
commit e4681a5511
4 changed files with 21 additions and 9 deletions

View File

@@ -14,13 +14,12 @@ options: -d|--dao: use DAO mode
EOF
}
OPTS=`getopt -o ds:nhr: --long dao,speed,no-spares,help,device -- "$@"`
OPTS=`getopt -o ds:hr: --long dao,speed,help,device -- "$@"`
eval set -- "$OPTS"
while true; do
case "$1" in
-d|--dao) burnopts="$burnopts -use-the-force-luke=dao"; shift;;
-s|--speed) burnopts="$burnopts -speed=$2"; shift 2;;
-n|--no-spares) burnopts="$burnopts -use-the-force-luke=spares:none"; shift;;
-d|--dao) burnopts="$burnopts -dao"; shift;;
-s|--speed) burnopts="$burnopts speed=$2"; shift 2;;
-r|--device) device=$2; shift 2;;
-h|--help) help; exit 1;;
--) shift; break;;
@@ -34,7 +33,7 @@ then
exit 1;
fi
growisofs $burnopts -Z $device="$1"
cdrskin $burnopts dev=$device "$1"
eject $device
sleep 4
eject -t $device

View File

@@ -113,7 +113,8 @@ EOF
#echo === Building backup_$discnum.iso ===
#mkisofs -iso-level 3 -f -JR -udf -V backup_$discnum -o backup_$discnum.iso tmp &>>"$progress"
mkisofs -allow-limited-size -iso-level 3 -f -r -udf -V backup_$discnum -o backup_$discnum.iso tmp &>>"$progress"
#mkisofs -allow-limited-size -iso-level 3 -f -r -udf -V backup_$discnum -o backup_$discnum.iso tmp &>>"$progress"
mkisofs -iso-level 3 -f -r -udf -V backup_$discnum -o backup_$discnum.iso tmp &>>"$progress"
if [ $? -ne 0 ]
then
echo "error in mkisofs"
@@ -134,7 +135,7 @@ sed "s/'/''/g;s/\([0-9a-f]*\) \(.*\)/update backup_index set discnum=$discnum,
if [ "$reserve" == "1" ]
then
# echo === Augmenting image with recovery data ===
dvdisaster -mRS02 -ci backup_$discnum.iso &>>"$progress"
dvdisaster -mRS03 -x 4 -ci backup_$discnum.iso &>>"$progress"
fi
#echo === Done preparing backup_$discnum.iso. ===

View File

@@ -4,4 +4,6 @@ source settings.sh
total=`echo "select sum(filesize) from backup_index;" | mysql -h $MYSQL_HOST -u $MYSQL_USER --password=$MYSQL_PASSWD $MYSQL_DB | tail -n 1`
backed_up=`echo "select sum(filesize) from backup_index where discnum is not null;" | mysql -h $MYSQL_HOST -u $MYSQL_USER --password=$MYSQL_PASSWD $MYSQL_DB | tail -n 1`
echo `echo "scale=1; 100*$backed_up/$total" | bc`"% complete, "`echo "scale=1; ($total-$backed_up)/1073741824" | bc `" GB remaining"
echo "(about "`echo "($total-$backed_up)/20020250624+1" | bc`" single-layer BD-R(s) with dvdisaster ECC)"
echo "(about "`echo "($total-$backed_up)/20020250624+1" | bc`" single-layer BD-R(s) with dvdisaster ECC)"
echo `echo "(20020250624-($total-$backed_up))/1048576" | bc`" MB available in next disc" | grep -v \-

View File

@@ -2,6 +2,12 @@
source settings.sh
if [ `find /mnt/media/pictures/from\ phone/ -name \*.[JjCc][PpRr][Gg2] | wc -l` -ne 0 ]
then
echo "move incoming pix first"
exit 1
fi
echo -n | mysql --default-character-set=utf8 -h $MYSQL_HOST -u $MYSQL_USER --password=$MYSQL_PASSWD $MYSQL_DB >/dev/null
if [ $? -ne 0 ]
then
@@ -10,11 +16,15 @@ then
fi
echo "select name from excluded_dirs;" | mysql --default-character-set=utf8 -h $MYSQL_HOST -u $MYSQL_USER --password=$MYSQL_PASSWD $MYSQL_DB | grep -v ^name\$ | sed "s/\//\\\\\//g;s/^/s\/^/;s/\$/\\\\\/.\*\/\//" >exclude.sed
TZ=UTC find $PATHS -type f -exec ls --full-time \{} \; | sed "s/.*$USER users //;s/\.0*//;s/ +0000//;s/ /\t/;s/ \\//\t\//;s/\(.*\)\t\(.*\)\t\(.*\)/\3\t\1\t\2/;s/$SEDROOTDIR\\///" | sed -f exclude.sed | grep -v ^\$ | sort | awk 'BEGIN {FS="\t"} {printf("%s\t%s\t%s\n",$1,$2,substr($3,1,19));}' >current-files
TZ=UTC find $PATHS -type f -exec ls --full-time \{} \; 2>&1 | awk '{print substr($0,length($1" "$2" "$3" "$4" "))}' | awk '{sz=$1; dt=$2" "substr($3,0,8); print substr($0,length($1" "$2" "$3" "$4" "))"\t"sz"\t"dt}' | sed "s/$SEDROOTDIR\\///" | sed -f exclude.sed | sort >current-files
echo "select filename, filesize, filedate from backup_index;" | mysql --default-character-set=utf8 -h $MYSQL_HOST -u $MYSQL_USER --password=$MYSQL_PASSWD $MYSQL_DB | grep -Pv "filename\tfilesize\tfiledate" | sort >backup-index.tmp
sed 's/[ \t]*$//' backup-index.tmp >backup-index.tmp~ && mv backup-index.tmp~ backup-index.tmp
sed 's/[ \t]*$//' current-files >current-files~ && mv current-files~ current-files
diff -u backup-index.tmp current-files >changes
grep ^- changes | grep -v ^--- >removals
grep ^+ changes | grep -v ^+++ >additions
rm changes