pctl recover and pctl reinstall
These commands are used to restore the original state of Container system and application files (to be more precise, of VZFS symlinks in the Container private area to system and application templates) if the Container gets broken for some reason. These are restored to the state as they were at the time when the Container was created and/or when other applications were added to the Container afterwards.
The difference between these two commands lies in the way the symlinks are restored. Whereas the
pctl recover
command simply rewrites the original symlinks to the Container private area (leaving the user files intact), the
pctl reinstall
command creates a new private area for the Container and re-writes the Container from scratch using its configuration files (thus retaining the Container IP address, hostname, resource control parameters, and all the other settings). The contents of the Container old private area are then copied to the
/old
directory in the new private area, to retain the user files.
The syntax of these commands is as follows:
pctl recover <
CT_ID
> [
options
]
pctl reinstall <
CT_ID
> [
options
]
The available options are listed below:
Option
|
Description
|
--resetpwdb
|
Removes the Container user database and creates a clean database as for any new installation.
|
--skipbackup
|
Does not save the contents of the old private area to the
/old
directory. Can be used with the
pctl reinstall
command only.
|
--scripts
script1
script2
...
|
Indicates the scripts to be executed during the Container reinstallation. These scripts are used to customize your application templates inside the new Container and bring them to the same state they were inside the old Container. By default, all available scripts are executed.
|
--listscripts
|
Lists the scripts that will be executed during the Container reinstallation to customize your application templates inside the new Container.
|
--desc
|
Displays the description of the scripts that will be executed during the Container reinstallation. Should be used together with the
--listscripts
option.
|
Note:
If any of the Container application templates cannot be added to the Container in a normal way, the reinstallation process will fail. This may happen, for example, if an application template was added to the Container using the
--force
option of the
vzpkgadd
command.
|