Development Guides Home >> Guide to Standardized Hooks >> Hookable Events
The PkgAcct category's events occur during backup creation.
This event takes place when the /usr/local/cpanel/scripts/pkgacct script creates the cpmove archive.
- Action code runs as:
- During transfers, the
rootuser. - While the system generates backup files, the user who owns the backup.
- During transfers, the
- Blocking attribute: Available.
- Escalate privileges attribute: Unavailable.
pre— Hook action code runs before thepkgacctscript collects or writes data.preFinalize– Hook action code runs before the system compresses or transfers thecpmovefile.postFinalize— Hook action code runs after the system compresses or transfers thecpmovefile. This stage does not occur if theskiphomedirvalue is1.
| Return | Type | Description | Possible values | Example |
|---|---|---|---|---|
workdir | string | The temporary working directory that the system uses to build the cpmove archive. | A valid directory path. | workingdir |
homedir | string | The user's home directory. | A valid directory path. | /home/username |
user | string | The user for whom the system will perform the backup. | A valid username on the server. | username |
| Return | Type | Description | Possible values | Example |
|---|---|---|---|---|
workdir | string | The temporary working directory that the system uses to build the cpmove archive. | A valid directory path. | workingdir |
homedir | string | The user's home directory. | A valid directory path. | /home/username |
user | string | The user for whom the system will perform the backup. | A valid username on the server. | username |
is_incremental | Boolean | Whether the archive is an incremental backup. |
| 1 |
is_split | Boolean | Whether the system split the archive into multiple files. |
| 1 |
is_tarball | Boolean | Whether the system will generate a tarball. |
| 1 |
is_backup | Boolean | Whether the archive is a backup. |
| 1 |
| Return | Type | Description | Possible values | Example |
|---|---|---|---|---|
workdir | string | The temporary working directory that the system used to build the cpmove archive. | A valid directory path. | workingdir |
homedir | string | The user's home directory. | A valid directory path. | /home/username |
user | string | The user for whom the system performed the backup. | A valid username on the server. | username |
is_incremental | Boolean | Whether the archive is an incremental backup. |
| 1 |
is_split | Boolean | Whether the system split the archive into multiple files. |
| 1 |
is_tarball | Boolean | Whether the system generated a tarball. |
| 1 |
is_backup | Boolean | Whether the archive is a backup. |
| 1 |
tarball | string | The tarball's path. If the is_split value is 1 or the pkgacct script's $create_tarball variable is false, the system does not return this parameter. | A valid file path. | /home/username/backup.tar.gz |
md5sum | integer | The tarball's md5sum value. If the is_split value is 1 or the pkgacct script's $create_tarball variable is false, the system does not return this parameter. | A positive integer. | 595f44fec1e92a71d3e9e77456ba80d1 |
This event takes place when the /usr/local/cpanel/scripts/pkgacct script restores the cpmove archive.
- Action code runs as:
- During restoration, the
rootuser. - While the system restores backup files, the user who owns the backup.
- During restoration, the
- Blocking attribute: Available.
- Escalate privileges attribute: Unavailable.
postExtract— Hook action code runs before the system restores thecpmovefile. This stage does not occur if theskiphomedirvalue is1.post— Hook action code runs after the system restores thecpmovefile.
| Return | Type | Description | Possible values | Example |
|---|---|---|---|---|
user | string | The source for which the system restored the backup. | The name of the account or the full path to the backup file. | account_name |
old_user | string | The user for whom the system performed the backup. | A valid username on the server. | username |
user_homedir | string | The user's home directory to which the system restored the backup. | A valid directory name. | /userhome |
domain | string | The domain on which to restore the account. | A valid domain on the server. | example.com |
| Return | Type | Description | Possible values | Example |
|---|---|---|---|---|
user | string | The source for which the system restored the backup. | The name of the account or the full path to the backup file. | account_name |
old_user | string | The user for whom the system performed the backup. | A valid username on the server. | username |
user_homedir | string | The user's home directory to which the system restored the backup. | A valid directory name. | /userhome |
domain | string | The domain on which to restore the account. | A valid domain on the server. | example.com |