#!/bin/bash

my_crontab="/crontab/root"
cron_temp="/tmp/crontemp"
cron_new="/tmp/cronnew"

while true; do
  inotifywait -m /mnt/user/Inbox/scanned -e moved_self && \
  cat $my_crontab > /tmp/crontemp
  awk '$0!~/scanned.sh/ { print $0 }' $cron_temp >$cron_new
  cp $cron_new $my_crontab
  /usr/bin/crontab $my_crontab
done