Skip to content

Commit

Permalink
add catchup script
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Nov 17, 2023
1 parent a22de88 commit 08d530d
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 1 deletion.
81 changes: 81 additions & 0 deletions bin/desi_tucson_transfer_catchup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash
#
# Parallel copy DESI mirror data, to catch up after outages.
#
if [[ -z "${DESISYNC_HOSTNAME}" ]]; then
echo "ERROR: DESISYNC_HOSTNAME is undefined!"
exit 1
fi
if [[ -z "${DESI_ROOT}" ]]; then
echo "ERROR: DESI_ROOT is undefined!"
exit 1
fi
syn="/usr/bin/rsync --archive --verbose --delete --delete-after --no-motd --password-file ${HOME}/.desi"
src=rsync://${DESISYNC_HOSTNAME}/desi
dst=${DESI_ROOT}
log_root=${HOME}/Documents/Logfiles

for d in engineering/focalplane engineering/focalplane/hwtables \
spectro/data \
spectro/redux/daily spectro/redux/daily/exposures spectro/redux/daily/preproc spectro/redux/daily/tiles \
spectro/nightwatch/kpno spectro/staging/lost+found; do
case ${d} in
engineering/focalplane) priority='nice'; exclude='--exclude archive --exclude hwtables --exclude *.ipynb --exclude .ipynb_checkpoints' ;;
engineering/focalplane/hwtables) priority='nice'; exclude='--include *.csv --exclude *' ;;
spectro/data) priority=''; exclude='--exclude 2018* --exclude 2019* --exclude 2020* --exclude 2021* --exclude 2022*' ;;
spectro/redux/daily) priority=''; exclude='--exclude *.tmp --exclude attic --exclude exposures --exclude preproc --exclude temp --exclude tiles' ;;
spectro/redux/daily/exposures) priority=''; exclude='--exclude *.tmp' ;;
spectro/redux/daily/preproc) priority=''; exclude='--exclude *.tmp --exclude preproc-*.fits --exclude preproc-*.fits.gz' ;;
spectro/redux/daily/tiles) priority=''; exclude='--exclude *.tmp --exclude temp' ;;
*) priority='nice'; exclude='' ;;
esac
log=${log_root}/catchup_$(tr '/' '_' <<<${d}).log
[[ -f ${log} ]] || touch ${log}
echo "${priority} ${syn} ${exclude} ${src}/${d}/ ${dst}/${d} &>> ${log} &"
# ${priority} ${syn} ${exclude} ${src}/${d}/ ${dst}/${d} &>> ${log} &
done

# log=${log_root}/catchup_engineering_focalplane.log
# [[ -f ${log} ]] || touch ${log}
# nice ${syn} --exclude archive --exclude hwtables --exclude \*.ipynb --exclude .ipynb_checkpoints \
# ${src}/engineering/focalplane/ ${dst}/engineering/focalplane/ &>> ${log} &

# log=${log_root}/catchup_engineering_focalplane_hwtables.log
# [[ -f ${log} ]] || touch ${log}
# nice ${syn} --include \*.csv --exclude \* \
# ${src}/engineering/focalplane/hwtables/ ${dst}/engineering/focalplane/hwtables/ &>> ${log} &

# log=${log_root}/catchup_spectro_data.log
# [[ -f ${log} ]] || touch ${log}
# ${syn} --exclude 2018\* --exclude 2019\* --exclude 2020\* --exclude 2021\* --exclude 2022\* \
# ${src}/spectro/data/ ${dst}/spectro/data/ &>> ${log} &

# log=${log_root}/catchup_spectro_redux_daily.log
# [[ -f ${log} ]] || touch ${log}
# ${syn} --exclude \*.tmp --exclude attic --exclude exposures --exclude preproc --exclude temp --exclude tiles \
# ${src}/spectro/redux/daily/ ${dst}/spectro/redux/daily/ &>> ${log} &

# log=${log_root}/catchup_spectro_redux_daily_exposures.log
# [[ -f ${log} ]] || touch ${log}
# ${syn} --exclude \*.tmp \
# ${src}/spectro/redux/daily/exposures/ ${dst}/spectro/redux/daily/exposures/ &>> ${log} &

# log=${log_root}/catchup_spectro_redux_daily_preproc.log
# [[ -f ${log} ]] || touch ${log}
# ${syn} --exclude \*.tmp --exclude preproc-\*.fits --exclude preproc-\*.fits.gz \
# ${src}/spectro/redux/daily/preproc/ ${dst}/spectro/redux/daily/preproc/ &>> ${log} &

# log=${log_root}/catchup_spectro_redux_daily_tiles.log
# [[ -f ${log} ]] || touch ${log}
# ${syn} --exclude \*.tmp --exclude temp \
# ${src}/spectro/redux/daily/tiles/ ${dst}/spectro/redux/daily/tiles/ &>> ${log} &

# log=${log_root}/catchup_spectro_nightwatch_kpno.log
# [[ -f ${log} ]] || touch ${log}
# nice ${syn} \
# ${src}/spectro/nightwatch/kpno/ ${dst}/spectro/nightwatch/kpno/ &>> ${log} &

# log=${log_root}/catchup_spectro_staging_lost+found.log
# [[ -f ${log} ]] || touch ${log}
# nice ${syn} \
# ${src}/spectro/staging/lost+found/ ${dst}/spectro/staging/lost+found/ &>> ${log} &
3 changes: 2 additions & 1 deletion py/desitransfer/tucson.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
'software/CiscoSecureClient']


includes = {'engineering/focalplane': ["--exclude", "archive", "--exclude", ".ipynb_checkpoints", "--exclude", "*.ipynb"],
includes = {'engineering/focalplane': ["--exclude", "archive", "--exclude", "hwtables", "--exclude", ".ipynb_checkpoints", "--exclude", "*.ipynb"],
'engineering/focalplane/hwtables': ["--include", "*.csv", "--exclude", "*"],
'spectro/desi_spectro_calib': ["--exclude", ".svn"],
'spectro/data': (' '.join([f'--exclude {y:d}*' for y in range(2018, time.localtime().tm_year)])).split(),
'spectro/redux/daily': ["--exclude", "*.tmp", "--exclude", "attic", "--exclude", "exposures", "--exclude", "preproc", "--exclude", "temp", "--exclude", "tiles"],
Expand Down

0 comments on commit 08d530d

Please sign in to comment.