Skip to content

Commit

Permalink
Adjust cron script for checking videos to only check if there are fun…
Browse files Browse the repository at this point in the history
…ctional MRI
  • Loading branch information
yarikoptic committed Jan 17, 2025
1 parent 98677dd commit baf076d
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions tools/cron-check-reproiner-videos
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,30 @@
#
# A simple script to ensure that we have at least one video file from today
#
prefix="/mnt/btrfs/@datafs/reprostim/Videos/$(date +%Y)/$(date +%m)/$(date +%Y.%m.%d)"
ssh reproiner "ls -ld $prefix*" | grep -q .
# || { echo "No files for $prefix"; exit 1; }
#
# Check first for DICOMs for functional sequences but not rest
#

set -eu -o pipefail

# To ease testing/troubleshooting, make easy to change day
DICOMS_DAY=$(date +%d)
VIDEOS_DAY="$DICOMS_DAY"

# Debugging conveniences, comment out for proper run
# DICOMS_DAY=13
# VIDEOS_DAY=16

DICOMS_DATE_DIR="/inbox/DICOM/$(date +%Y)/$(date +%m)/${DICOMS_DAY}"
VIDEOS_PREFIX="/mnt/btrfs/@datafs/reprostim/Videos/$(date +%Y)/$(date +%m)/$(date +%Y.%m).${VIDEOS_DAY}"
if ! ssh [email protected] echo test > /dev/null; then
echo "E: cannot connect/execute on rolando"
fi

if ! ssh [email protected] ls -d "$DICOMS_DATE_DIR/*/*_task-*" | grep -v '_task-rest' | grep -q .; then
echo "D: no relevant DICOMs for $DICOMS_DATE_DIR, no videos expected"
exit 0
fi

ssh reproiner "ls -ld $VIDEOS_PREFIX*" | grep -q .

0 comments on commit baf076d

Please sign in to comment.