Guide to Standardized Hooks - PkgAcct Functions

Introduction

The PkgAcct category's events occur during backup creation.

Create


This event takes place when the /scripts/pkgacct script creates the cpmove archive.

Available Stages:

  • pre — Hook action code runs before the /scripts/pkgacctscript collects or writes data.
  • preFinalize — Hook action code runs before the system compresses or transfers the cpmove file.
  • postFinalize — Hook actions code runs after the system compresses or transfers the cpmove file.

Note:

The postFinalize stage does not occur if theskiphomedir value is 1

Action Code Runs As:

  • During transfers, the root user.
  • While the system generates backup files, the user who owns the backup.

Blocking Attribute:

Escalate Privileges Attribute:

Output parameters

Note:

The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage. 

Pre

 Parameter 

 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

 PreFinalize

 

Parameter

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 — Incremental backup.
  • 0 — Not an incremental backup.

1

is_split

boolean

Whether the system split the archive into multiple files.

  • 1 — Split.
  • 0 — Not split.

1

is_tarball

boolean

Whether the system will generate a tarball.

  • 1 — Will generate.
  • 0 — Will not generate.

1

is_backup

boolean

Whether the archive is a backup.

  • 1 — Backup.
  • 0 — Not a backup.

1

 

 PostFinalize

 

Parameter

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 performed the backup.

A valid username on the server.

username

 is_incremental 

 boolean 

Whether the archive is an incremental backup.

  • 1 — Incremental backup.
  • 0 — Not an incremental backup. 

1

is_split

boolean

Whether the system split the archive into multiple files.

  • 1 — Split.
  • 0 — Not split.

1

is_tarball

boolean

Whether the system generated a tarball.

  • 1 — Will generate.
  • 0 — Will not generate.

1

is_backup

boolean

Whether the archive is a backup.

  • 1 — Backup.
  • 0 — Not a backup.

1

tarball

string

The tarball's path.

Note:

 If the is_split value is 1 or thepkgacct script's $create_tarballvariable is false, the system does notreturn this parameter. 

A valid file path.

/home/username/backup.tar.gz

md5sum

integer

The tarball's md5sum value.

Note:

If the is_split value is 1 or thepkgacct script's $create_tarballvariable is false, the system does notreturn this parameter. 

A positive integer.

 595f44fec1e92a71d3e9e77456ba80d1 

 

 

 

 

  • 9 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....