Updated on 2024-09-14 GMT+08:00

OSMT Command Help Information

  • Run osmt -h to display the OSMT help information.
    [root@localhost SOURCES]# osmt -h
    usage: osmt [-h] {update,rollback} ...
    positional arguments:
      {update,rollback}
        update           update os version or packages
        rollback         rollback last update
        remove           remove backup files in store path
        config           modify config file by command line
        job              handle upgrade task.
    optional arguments:
      -h, --help          show this help message and exit
    Table 1 OSMT help parameters

    Parameter

    Description

    update

    Upgrades the OS or update the RPM packages.

    rollback

    Rolls back the OS or RPM packages.

    remove

    Deletes the backup files from the storage path.

    config

    Queries or modifies the configuration file.

    job

    Queries or manages the upgrade tasks.

    -h, --help

    (Optional) Provides help information of the osmt command.

  • Run osmt update -h to display the help information about the OS or RPM package updates.
    [root@localhost SOURCES]# osmt update -h
    usage: osmt update [-h] [--nosignature] [-s] [--all] [--security] [--version] [-a] [-p  PKGS [PKGS ...]] [-e  EXCLUDE_PKGS [EXCLUDE_PKGS ...]] [-v  RELEASEVER] [-r  REBOOT_CONFIG]
                       [-b BETWEEN] [-j] [-c]
    optional arguments:
      -h, --help            show this help message and exit
      --nosignature         ignore the signature of packages
      -s , --show           show updateinfo
      --all                 show all pkgs which can update, 'osmt update --show --all'
      --security            show security pkgs which can update
      --version             show all version can update to
      -a , --auto           auto update use config file
      -p  PKGS [PKGS ...], --pkgs PKGS [PKGS ...]
                            specify the packages to upgrade
      -e  EXCLUDE_PKGS [EXCLUDE_PKGS ...], --exclude_pkgs EXCLUDE_PKGS [EXCLUDE_PKGS ...]
                            specify the packages not to upgrade
      -v  RELEASEVER, --releasever RELEASEVER
                            specify the release version to upgrade
      -r  REBOOT_CONFIG, --reboot_config REBOOT_CONFIG
                            you can choose between always, never or a specific time. 'always': reboot os after update ends if need. 'never': never reboot os automatically. '<specific time>':
                            reboot at specified time, format like "2020-02-02 2:02:02".
      -b BETWEEN, --between BETWEEN
                            start upgrade time and end upgrade time, format like: '2020-02-02 2:02:02','2020-02-02 4:02:02'
      -j , --job            run upgrade in background.
      -c, --check           check upgrade task.
      -V, --verbose         show more log to screen
      -o, --preinstalled-only
                            upgrade preinstalled packages only
      -t, --retry           retry previous upgrade action
      --nocheck             do not check before upgrade
      -f, --fix             auto fix some system problems checked out
    Table 2 OSMT update parameters

    Parameter

    Description

    -h, --help

    Provides help information about the osmt update command.

    --nosignature

    Specifies not to filter the RPM packages to be updated by package signature.

    -s,--show

    Displays available upgrade or update information.

    • --all: displays all RPM packages to be updated.
    • --security: displays the security packages to be updated.
    • --version: displays the version to be upgraded to.

    -a,--auto

    Specifies the RPM package update method. This parameter is mutually exclusive with -v, -p, and -e.

    -p,--pkgs

    Specifies the whitelisted RPM packages to be updated. This parameter is mutually exclusive with -v and -a.

    -e,--exclude_pkgs

    Specifies the blacklisted RPM packages that will not be updated. This parameter is mutually exclusive with -v and -a.

    -v , --releasever

    Specifies the target HCE version.

    -r, --reboot_config

    Specifies the restart configuration.

    • always: restarts the OS after the update if some package updates are only applied after a restart. If there are no such packages, the OS will not restart.
    • never: does not restart the OS after the update.
    • <specific time>: specifies a specific restart time. If some package updates are only applied after a restart, the OS will restart at the specified time after the update. The restart time is in the format of "2020-02-02 2:02:02". If there are no such packages, the OS will not restart.

    -b, --between

    Specifies the start time and end time of automatic updates using osmt-agent. The value is in the format of "HH:MM-HH:MM".

    If the end time is smaller than the start time, the update period covers two dates. For example, 22:00-05:00 indicates an update period from 22:00 on the current day to 05:00 on the next day.

    -j, --job

    Performs the upgrade using background processes.

    -c, --check

    Checks the system status before the upgrade. This parameter is optional. The system also performs the check before executing the upgrade.

    You are advised to add -c to the update command to perform the check. For example, run osmt update -a -c to perform the check before running the osmt update -a update command.

    -V, --verbose

    (Optional) Displays detailed upgrade information.

    -o, --preinstalled-only

    (Optional) Only the RPM package list in /etc/osmt/preinstalled.list is upgraded. This parameter is valid only for version upgrade.

    -t, --retry

    (Optional) Retries the upgrade.

    --nocheck

    (Optional) No checks will be performed before the upgrade. The upgrade starts directly.

    -f, --fix

    (Optional) Some environment check problems are automatically resolved during the version upgrade.

  • Run osmt rollback -h to display the help information about the OS or RPM package rollbacks.
    usage: osmt rollback [-h] [-r {never,always}]
    optional arguments:
    -h, --help            show this help message and exit
    -r {never,always}, --reboot_config {never,always}
    whether to reboot after rollback
    -V, --verbose         show more log to screen
    -t, --retry           retry previous upgrade action
    --nocheck             do not check before rollback
    Table 3 OSMT rollback parameters

    Parameter

    Description

    -h, --help

    Provides help information about the osmt rollback command.

    -r, --reboot_config

    Specifies the restart configuration.

    -V, --verbose

    (Optional) Displays detailed process logs.

    -t, --retry

    (Optional) Retries the rollback.

    --nocheck

    (Optional) No checks will be performed before the rollback. The rollback starts directly.

  • Run osmt config -h to display the help information about configuration item modification or query.
    usage: osmt config [-h]  [-k] { minimal_interval,cycle_time...}  [-v VALUE]
    optional arguments:
    -h, --help            show this help message and exit
    -k {minimal_interval,cycle_time…} --key {minimal_interval,cycle_time...}
    -v VALUE, --value VALUE
    -V, --verbose         show more log to screen
    Table 4 OSMT configuration parameters

    Parameter

    Description

    -h, --help

    Provides help information about the osmt config command.

    -k, --key

    Specifies the keys to be queried or modified.

    -v, --value

    Specifies the values of the keys to be modified.

    -V, --verbose

    (Optional) Displays detailed process logs.

    You are advised to run osmt config to modify the configuration file. Any modification made to the file using a method other than osmt config may lead to abnormal OSMT functions.

  • Run osmt job -h to display the help information about task management.
    usage: osmt job [-h] [-s] [-c] [-d DELAY] [-y]
    
    optional arguments:
      -h, --help            show this help message and exit
      -s, --show            show task info.
      -c, --cancel          cancel current task.
      -d DELAY, --delay DELAY
                            delay task
      -y, --yes             never ask for yes.
      -V, --verbose         show more log to screen
    Table 5 OSMT task management parameters

    Parameter

    Description

    -h, --help

    Provides help information about the osmt job command.

    -s, --show

    Displays background task information.

    -d DELAY, --delay DELAY

    Allows for postponing the pending restart task. For example, to postpone the task for 1 hour and 50 minutes, set the value to "1:50:00".

    -c, --cancel

    Cancels the current job.

    -y, --yes

    Considers by default that the user agrees the operation.

    -V, --verbose

    (Optional) Displays detailed process logs.