# Env var HAFB should be defined in .bashrc # Also defined DVDRD (e.g. /mnt/cdrom), DVDWR (e.g. 2,0,0), DVDSPEED (e.g. 2) # Then this script should be sourced in .bashrc like this # # if [ -f $HAFB/bashrc_dvd ]; then # . $HAFB/bashrc_dvd # fi if [ -z "$HAFB" ]; then HAFB=/hafb fi L1A=$HAFB/l1a L1A_CORE=$L1A/0_core L1A_GET=$L1A/1_get L1A_DVD=$L1A/2_dvd L1A_HOLD=$L1A/3_hold L1A_DVDGZ=$L1A/4_dvdgz L1A_ATTIC=$L1A/5_attic FTS=$HAFB/fts FTS_MIRROR=$FTS/1_mirror FTS_DVD=$FTS/2_dvd FTS_ATTIC=$FTS/3_attic export HAFB export L1A_GET L1A_DVD L1A_HOLD L1A_DVDGZ L1A_ATTIC L1A export FTS_MIRROR FTS_DVD FTS_ATTIC FTS # CD and DVD info will be different for each machine # We put in defaults here. To override them defined the # env vars in .bashrc before sourcing this script. if [ -z "$DVDRD" ]; then DVDRD="/media/CDROM" fi if [ -z "$CDRD" ]; then CDRD="/media/CDROM" fi if [ -z "$DVDWR" ]; then DVDWR="ATA:0,0,0" fi if [ -z "$CDWR" ]; then CDWR="ATA:0,0,0" fi if [ -z "$DVDSPEED" ]; then DVDSPEED=2 fi if [ -z "$CDSPEED" ]; then CDSPEED=8 fi export DVDRD DVDWR DVDSPEED export CDRD CDWR CDSPEED # Download files to $L1A_GET from HAFB, unzip and unpack, # then move unzipped L1A files to $L1A_DVD alias l1a_core='l1a.py celeste.nso.edu data/l1a -sftp -maxftp=2 -source=$L1A_CORE -file_list=$L1A/l1a_files.txt -silent -nounpack -move=$L1A_GET' alias l1a_unpack='l1a.py -source=$L1A_GET -file_list=$L1A/l1a_files.txt -destination=SMEIDB? -zipdir -move=$L1A_DVD -silent -noclones -all_l1a' alias l1a_get='l1a.py celeste.nso.edu data/l1a -sftp -maxftp=2 -source=$L1A_GET -destination=SMEIDB? -file_list=$L1A/l1a_files.txt -zipdir -move=$L1A_DVD -silent -noclones 2> $L1A/ch2.tmp' # Burn primary DVD from unzipped L1A files in $L1A_DVD, # then move unzipped L1A files to $L1A_HOLD. if [ -n "$DVDWR" ]; then alias l1a_dvd='burnfiles.py -dvd -sort -logfile=$L1A_DVD/l1a_dvd.txt $L1A_DVD $L1A_HOLD -pattern=*.buf -dev=$DVDWR -speed=$DVDSPEED' fi # Compare files on primary DVD with files in $L1A_HOLD. # If file is the same, gzip and move it to $L1A_DVDGZ alias l1a_diff='compare_tree -gz $L1A_HOLD $DVDRD $L1A_DVDGZ' # Burn backup DVD of gzipped L1A files in $L1A_DVDGZ, # and move them to L1A_ATTIC when done. if [ -n "$DVDWR" ]; then alias l1a_dvdgz='burnfiles.py -dvd -sort -clean -before=7 -logfile=$L1A_DVDGZ/l1a_dvdgz.txt $L1A_DVDGZ $L1A_ATTIC -pattern=*.buf.gz -dev=$DVDWR -speed=$DVDSPEED' fi # Compare backup DVD with $L1A_ATTIC, remove identical files alias l1a_diffgz='compare_tree -rm $L1A_ATTIC $DVDRD' alias l1a_tail='tail -f $L1A/ch2.tmp' alias l1a_move='l1a_list -mv' alias l1a_dir='ssh smei@celeste.nso.edu "ls -alF data/l1a/*.buf"' alias fts_mirror='rsync -vlptgoD --delete smei@celeste.nso.edu:data/SCA/*.FIT $FTS_MIRROR ; hafbfts_sync.py' if [ -n "$DVDWR" ]; then alias fts_dvd='burnfiles.py -dvd -sort -clean -logfile=$FTS_DVD/fts_dvd.txt -timestamp $FTS_DVD $FTS_ATTIC -pattern=*.fit -dev=$DVDWR -speed=$DVDSPEED' alias fts_diff='compare_tree -rm $FTS_ATTIC $DVDRD' fi