diff --git a/VERSION b/VERSION index 3dbac14..588b40e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.2,fix +2.1.3,remove cvttdata diff --git a/scripts/mkt_data/checklists/crypto_md_chcklst.sh b/scripts/mkt_data/checklists/crypto_md_chcklst.sh index a9ec92f..65af267 100755 --- a/scripts/mkt_data/checklists/crypto_md_chcklst.sh +++ b/scripts/mkt_data/checklists/crypto_md_chcklst.sh @@ -26,10 +26,10 @@ run_checklist() { declare -A Commands Commands=( ["hs01:cloud21"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud21/${yr}/${mn} | tail -5" - ["hs01:cvttdata"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cvttdata/${yr}/${mn} | tail -5" + ["hs01:cloud28"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud28/${yr}/${mn} | tail -5" ["hs01:sim"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/sim/ | tail -5" ["cloud21:cloud21"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud21/${yr}/${mn} | tail -5" - ["cloud21:cvttdata"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cvttdata/${yr}/${mn} | tail -5" + ["cloud21:cloud28"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud28/${yr}/${mn} | tail -5" ["cloud21:sim"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/sim | tail -5" ["gpushnik"]="ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/crypto_md | tail -10'" ) diff --git a/utils/archive_logs.sh b/utils/archive_logs.sh index 574ceeb..3bb4c33 100755 --- a/utils/archive_logs.sh +++ b/utils/archive_logs.sh @@ -11,9 +11,10 @@ function usage { echo Starting $0 $* -LogDir=${1} +# ---- D e f a u l t s LogArchiveDir=/works/archive/logs DateCriteria="2 days ago" +# ---- D e f a u l t s # ---------------- cmdline diff --git a/utils/move_archives.sh b/utils/move_archives.sh index 1c1c4ef..2162886 100755 --- a/utils/move_archives.sh +++ b/utils/move_archives.sh @@ -1,40 +1,57 @@ #!/bin/bash - -# FOR cloud hosts with limited disk space - move to storage server +# FOR hosts with limited disk space - move to storage server function usage { - echo "Usage: ${0} " + echo -n "Usage: ${0}" + echo -n " -H " + echo -n " [ -A (default /works/archive)]" + echo -n " [-D (default: '2 days ago')]" + echo exit 1 } echo Starting $0 $* - +# ---- D e f a u l t s +ArchiveDir=/works/archive +DateCriteria="2 days ago" FromHost=$(hostname -s) +# ---- D e f a u l t s + +# ---------------- cmdline +while getopts "A:H:D:" opt; do + case ${opt} in + A ) + ArchiveDir=$OPTARG + ;; + H ) + FromHost=$OPTARG + ;; + D ) + DateCriteria=$OPTARG + ;; + \? ) + echo "Invalid option: -$OPTARG" >&2 + usage + ;; + : ) + echo "Option -$OPTARG requires an argument." >&2 + usage + ;; + esac +done +# ---------------- cmdline + + if [ "${FromHost}" == "" ] then usage fi -ArchiveDir=${2} -if [ "${ArchiveDir}" == "" ] -then - usage -fi - -Days=${3} -if [ "${Days}" == "" ] -then - Days=2 -fi - -DateCriteria="${Days} days ago" - TargetHost=cloud21.cvtt.vpn TargetRootDir=/opt/store/cvtt/archive -Oldest=$(date -d "${DateCriteria}" '+%Y-%m-%d') -Now=$(date '+%Y%m%d_%H%M%S') +Oldest=$(date -d "${DateCriteria}" '+%Y-%m-%d %H:%M:%S') echo "Looking for log files older than ${DateCriteria} in ${ArchiveDir}" Cmd="find ${ArchiveDir}/" @@ -45,7 +62,7 @@ Cmd="${Cmd} -o -name '*.logs.*'" Cmd="${Cmd} -o -name '*.tgz'" Cmd="${Cmd} ')'" Cmd="${Cmd} -type f" -Cmd="${Cmd} -not -newermt ${Oldest}" +Cmd="${Cmd} -not -newermt \"${Oldest}\"" echo ${Cmd} files=$(eval ${Cmd})