__cron should replace entrys with his id, try 2

This commit is contained in:
Daniel Heule 2014-01-14 10:11:33 +01:00
parent 6afc4b82c2
commit 5a114cf6ae
2 changed files with 3 additions and 2 deletions

View file

@ -22,4 +22,4 @@
name="$__object_name"
user="$(cat "$__object/parameter/user")"
crontab -u $user -l 2>/dev/null | grep "# $name\$" | head -n 1 || true
crontab -u $user -l 2>/dev/null | grep "# $name\$" || true

View file

@ -78,8 +78,9 @@ DONE
case "$state_should" in
present)
# if we insert new entry, filter also all entrys out with the same id
echo "("
echo "crontab -u $user -l 2>/dev/null | grep -v -E \"$filter\" 2>/dev/null || true"
echo "crontab -u $user -l 2>/dev/null | grep -v -E \"$filter\" | grep -v \"# $name\\$\" 2>/dev/null || true"
echo "echo '$entry'"
echo ") | crontab -u $user -"
;;