cronoff 249 B

123456789101112
  1. #!/bin/bash
  2. set -e
  3. set -u
  4. set -E
  5. set -o pipefail
  6. crontab -l | awk '/#BETWEEN#/ {flag=1;print;next} /#HERE#/{flag=0} flag {print "# " $0 } !flag {print}' | crontab -
  7. echo "### Turned off on $(date -Is)" > ~/crontab.out
  8. crontab -l >> ~/crontab.out