-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust cron script for checking videos to only check if there are fun…
…ctional MRI
- Loading branch information
1 parent
98677dd
commit baf076d
Showing
1 changed file
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 . | ||
|