#!/bin/bash

exec 2>&1

. ~plander/lander.conf

if [ "$LANDER_QUEUE_TYPE" == "fs" ]; then

	out=`find $LANDER_RAWDIR/* -maxdepth 0 -type d -mmin +60 | grep -v lander[34]`
	msg="These directories have not changed in the last hour:\n"

else
	epoch_ms=$($LANDER_HDFS -stat "%Y" /lander/raw/landeri2)
	now=$(date -u +%s)
	if (( (now - epoch_ms/1000) > 3600 )); then
		msg="These directories have not changed in the last hour (hdfs):\n"
		out=landeri2
	fi
fi
[ -n "$out" ] && echo -e "${msg}${out}" | mail -s "Lander delivery notification" $LANDER_ADMIN
