omv-confdbadm update conf.system.cron.job Validation Exception: minute: The value '30' is not a string.

  • I have tried to apply some values to OMV using shell. In general omv-confdbadm update works, but with this one particulat it drives my crazy. For example the simpliest job...


    config.xml example:

    <crontab>

    <!--

    <job>

    <uuid>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</uuid>

    <enable>0|1</enable>

    <execution>exactly|hourly|daily|weekly|monthly|yearly|reboot</execution>

    <sendemail>0|1<sendemail>

    <type>reboot|shutdown|standby|userdefined</type>

    <comment>xxx</comment>

    <minute>[00-59|*]</minute>

    <everynminute>0|1</everynminute>

    <hour>[00-23|*]</hour>

    <everynhour>0|1</everynhour>

    <dayofmonth>[01-31|*]</dayofmonth>

    <everyndayofmonth>0|1</everyndayofmonth>

    <month>[01-12|*]</month>

    <dayofweek>[1-7|*]</dayofweek>

    <username>xxx</username>

    <command>xxx</command>

    </job>

    -->

    </crontab>


    in config.xml:

    <job>

    <uuid>32664b22-5a9d-11ec-8834-6f00f75b23ee</uuid>

    <enable>1</enable>

    <execution>exactly</execution>

    <sendemail>1</sendemail>

    <comment>Monthly backup</comment>

    <type>userdefined</type>

    <minute>30</minute>

    <everynminute>0</everynminute>

    <hour>4</hour>

    <everynhour>0</everynhour>

    <month>*</month>

    <dayofmonth>1</dayofmonth>

    <everyndayofmonth>0</everyndayofmonth>

    <dayofweek>*</dayofweek>

    <username>root</username>

    <command>/usr/sbin/omv-backup</command>

    </job>


    #omv-confdbadm read --prettify conf.system.cron.job


    [

    {

    "command": "/usr/sbin/omv-backup",

    "comment": "Monthly backup",

    "dayofmonth": "1",

    "dayofweek": "*",

    "enable": true,

    "everyndayofmonth": false,

    "everynhour": false,

    "everynminute": false,

    "execution": "exactly",

    "hour": "4",

    "minute": "30",

    "month": "*",

    "sendemail": true,

    "type": "userdefined",

    "username": "root",

    "uuid": "32664b22-5a9d-11ec-8834-6f00f75b23ee"

    }

    ]


    #omv-confdbadm read conf.system.cron.job

    [{"uuid": "32664b22-5a9d-11ec-8834-6f00f75b23ee", "enable": true, "execution": "exactly", "sendemail": true, "comment": "Comiesi\u0119czna kopia systemu", "type": "userdefined", "minute": "30", "everynminute": false, "hour": "4", "everynhour": false, "month": "*", "dayofmonth": "1", "everyndayofmonth": false, "dayofweek": "*", "username": "root", "command": "/usr/sbin/omv-backup"}]



    and update command I use:

    omv-confdbadm update conf.system.cron.job '{"uuid":"32664b22-5a9d-11ec-8834-6f00f75b23ee","enable":false,"execution":"exactly","sendemail":true,"comment":"","type":"userdefined","minute":"30","everynminute":false,"hour":"1","everynhour":false,"month":"*","dayofmonth":"*","everyndayofmonth":false,"dayofweek":"7","username":"root","command":"/usr/sbin/omv-backup"}'


    After this command, I get:

    Traceback (most recent call last):

    File "/usr/sbin/omv-confdbadm", line 76, in <module>

    sys.exit(main())

    File "/usr/sbin/omv-confdbadm", line 72, in main

    return cmd_inst.execute(*sys.argv)

    File "/usr/share/openmediavault/confdbadm/commands.d/update.py", line 57, in execute

    obj.set_dict(cmd_args.data)

    File "/usr/lib/python3/dist-packages/openmediavault/config/object.py", line 208, in set_dict

    self.set(key, value, validate)

    File "/usr/lib/python3/dist-packages/openmediavault/config/object.py", line 184, in set

    self.model.property_validate(name, value)

    File "/usr/lib/python3/dist-packages/openmediavault/config/datamodel.py", line 272, in property_validate

    self.schema.validate(value, name)

    File "/usr/lib/python3/dist-packages/openmediavault/json/schema.py", line 175, in validate

    self._validate_type(value, schema, name)

    File "/usr/lib/python3/dist-packages/openmediavault/json/schema.py", line 229, in _validate_type

    raise last_exception

    File "/usr/lib/python3/dist-packages/openmediavault/json/schema.py", line 209, in _validate_type

    self._validate_string(value, schema, name)

    File "/usr/lib/python3/dist-packages/openmediavault/json/schema.py", line 275, in _validate_string

    raise SchemaValidationException(

    openmediavault.json.schema.SchemaValidationException: minute: The value '30' is not a string.


    I run and applied successfully so far: conf.webadmin, conf.system.time, conf.system.notification.email, conf.system.notification.notification (each separately), conf.system.powermngmnt, conf.service.smartmontools, conf.service.ssh, conf.system.monitoring.perfstats, but the most wanted cron job entries remains mistry to me. After some modifications I get this error about dayofmonth. I would not post question about it if it would not give me terrible headake. There is very little info in manual section about "omv-confdbadm update". There is not even mentioned that applying requires particular salt command. And there is no information wich omv-confdbadm command is connected to salt command. I still try to figure out, what salt command applies conf.system.monitoring.perfstats settings. Those commands are not even searchable in google. I get one or two hits per "omv-confdbadm update conf.***". Or am I missing something?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!