HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //snap/certbot/current/usr/share/augeas/lenses/dist/tests/test_cron_user.aug
module Test_Cron_User =

let s = "MAILTO=cron@example.com
31 * * * * ${HOME}/bin/stuff
54 16 * * * /usr/sbin/tmpwatch -umc 30d ${HOME}/tmp\n"

let lns = Cron_User.lns

test lns get s =
  { "MAILTO" = "cron@example.com" }
  { "entry" = "${HOME}/bin/stuff"
    { "time"
      { "minute" = "31" }
      { "hour" = "*" }
      { "dayofmonth" = "*" }
      { "month" = "*" }
      { "dayofweek" = "*" }
    }
  }
  { "entry" = "/usr/sbin/tmpwatch -umc 30d ${HOME}/tmp"
    { "time"
      { "minute" = "54" }
      { "hour" = "16" }
      { "dayofmonth" = "*" }
      { "month" = "*" }
      { "dayofweek" = "*" }
    }
  }

test lns put s after
rm "/MAILTO";
rm "/entry[time/minute = '54']";
set "/entry[. = '${HOME}/bin/stuff']/time/minute" "24" =
  "24 * * * * ${HOME}/bin/stuff\n"