La commande 'tunrestore' permet de restaurer les variables des paramètres systèmes depuis le fichier passé en argument.

La commande de base est 'tunrestore -f /tmp/maconfig.bkp'

Ainsi, après avoir sauvegardé une configuration avec la commande 'tunsave', il est simple de replacer les anciennes valeurs par la commande 'tunrestore'.

L'option '-r' permet de spécifier que la prise d'effet ne se faite qu'au prochaine reboot( En écrivant dans '/etc/nextboot').

 

Ci-dessous la documentation officielle.

tunrestore Command

Purpose

       Restores tunable parameter values from a file.

Syntax

       tunrestore [ -r ] -f Filename

       tunrestore -R

       Restriction: tunrestore -R can only be called from inittab.

Description

       The tunrestore command restores all tunable parameters values stored in a file.

       The  tunrestore -f Filename immediately applies Filename. All tunables listed in Filename are set to the value defined in this
       file. Tunables not listed in Filename are kept unchanged. Tunables explicitly set to DEFAULT are set to their default value.

       The tunrestore -r -f Filename applies Filename for the next boot. This is achieved by checking the specified file for
       inconsistencies (the equivalent of running tuncheck on it) and copying it over to /etc/tunables/nextboot. If bosboot is
       necessary, the user will be offered to run it.

       The tunrestore -R is only used during reboot. All of the tunables that are not yet set to the value defined in the nextboot file
       are modified. Tunables that are not listed in the nextboot file are forced to their default value. All actions, warnings and
       errors are logged into the /etc/tunables/lastboot.log file. Note that when modification is made to restricted tunables, a system
       errlog entry is added, including the list of all tunable commands controlling the modified restricted tunables and a reference to
       the /etc/tunables/lastboot.log file.

       Additionally, a new tunable file called /etc/tunables/lastboot is automatically generated. That file has all of the tunables
       listed with numerical values. The values representing default values are marked with the comment DEFAULT VALUE. The values that
       are different from the default values for restricted tunables are marked with the comment # RESTRICTED not at default value. The
       info stanza of the new tunable file includes the checksum of the /etc/tunables/lastboot.log file to make sure pairs of the
       lastboot/lastboot.log files can be identified.

Flags
       Item
            Description
       -f  Filename
            Specifies the name of the tunable file to apply. If it does not contain the '/' (forward slash) character, the name is
            relative to /etc/tunables.
        -r
            Makes the specified file become the new nextboot file.
       -R
            Restores /etc/tunables/nextboot during boot process.

Tunable Parameter Types
       Item
            Description
       Dynamic
            Can be changed at any time.
       Static
            Can never be changed
       Reboot
            Can only be changed during the reboot sequence
       Bosboot

            Can only be changed by running bosboot and rebooting the machine
       Mount
            Changes made are only effective for future filesystems or directory mountings
       Incremental
            Can only be incremented, except at boot time.
       Connect
            Changes are only effective for future socket connections.

Examples
       1    To restore all tunable values stored in /etc/tunables/mytunable, enter:

            tunrestore -f mytunable


       2    To validate /etc/tunables/mytunable and make it the new nextboot file, enter:

             tunrestore -r -f mytunable

Files
       Item
            Description
       /usr/sbin/tunrestore
            Contains the tunrestore command.
       /etc/tunables
            Contains tunable files.
       /etc/tunables/nextboot
            Contains the values to be applied during the next boot.
       /etc/tunables/lastboot
            Contains the values of all tunables after the last boot.
       /etc/tunables/lastboot.log
            Contains messages, warnings and errors emitted by tunrestore during the last boot.

 

icon phone
Téléphone/Whatsapp : +33 (0)6 83 84 85 74
icon phone