buda-base / drs-deposit

Harvard DRS Deposit base
1 stars 0 forks source link

Recover accidentally deleted database of batch build. for each batch build dir bds, call 'updateBuildStatus $bds success` #89

Closed jimk-bdrc closed 3 years ago

jimk-bdrc commented 3 years ago

As simple as calling 'updateBuildStatus 'success'

jimk-bdrc commented 3 years ago

Along the way, I looked for DRS deposits in the DB which did not have a corresponding batchBuild. There were a few thousand. Along the way built a db that GNU locate can use to search multiple directory trees efficiently.

#!/usr/bin/env bash
#
# Build a locate db for batchBuilds.
# Search these paths
export LOCALPATHS="$PR/batchBuilds $PR/batchBuildsFromBodhi $PR/deposited-batch-builds /Volumes/D\
RS_Staging/DRS/oldprod"

export PRUNEPATHS=/Volumes/DRS_Staging/DRS/oldprod/batchLinks

export OUTFILE=$PR/locate.db

export FINDOPTIONS=" -type d"
#
# Use ignore links, because oldprod/batchLinks is all links
updatedb --findoptions="$FINDOPTIONS" --localpaths="$LOCALPATHS" --prunepaths="$PRUNEPATHS" --out\
put="$OUTFILE"

See

cat DepoVols.lst | parallel 'locate --database=/Volumes/DRS_Staging/DRS/prod/locate.db --basename {}'