Page tree
Skip to end of metadata
Go to start of metadata

For cPanel & WHM version 64

Overview

The /usr/local/cpanel/scripts/backups_list_user_files script locates a user's backup files and returns all of the backup files in the Comma-Separated Value (CSV) format. The output format depends on the backup file type:

  • The uncompressed and compressed backup files return a string with the following information:

    • The file size.

    • The file date.

    • The filename in its archive.

    • The path to the archive in which the file resides.

    • The UID and GID values, if they exist.

  • The incremental backup files return a string with the following information:

    • The file size.

    • The file date.

    • The path to the archive in which the file resides.

    • The FILE flag.

      Note:

      The FILE flag is a placeholder for the full path to the file.

    • The UID and GID values, if they exist.

      Note:

      Incremental backup files always return a value of 0.

The /usr/local/cpanel/scripts/backups_list_user_files script

To query and return a list of backup files, run the following command as the root user:

/usr/local/cpanel/scripts/backups_list_user_files --user=[username] [arguments]

Arguments

The /usr/local/cpanel/scripts/backups_list_user_files script accepts the following arguments:

Argument

Description

Example
--regexp=[string]

Returns the regular expression search results.

Note:

This argument only accepts one search value.

--regexp='example'

--skipcompressed

Bypasses any compressed backup files.

--skipcompressed

Example

For example, the following command uses the --regexp argument to return results for the username user that match the example value:

/usr/local/cpanel/scripts/backups_list_user_files --user=username --regexp='example' |tail -n 8

The system will return the following output:

0,"2012-11-21 10:20",/backup/weekly/2017-09-17/accounts/username/homedir/etc/example,FILE,0,0
0,"2012-11-21 10:20",/backup/weekly/2017-09-17/accounts/username/homedir/etc/username.tld/example,FILE,0,0
4,"2017-08-23 12:18",/backup/weekly/2017-09-17/accounts/username/homedir/accounts/username/homedir/etc/example,FILE,0,0
106,"2017-09-24 08:03",username/example,/backup/weekly/2017-09-24/username/username.tar.gz,0,0
0,"2017-09-24 08:03",username/example,/backup/weekly/2017-09-24/accounts/username.tar.gz,0,0
0,"2012-11-21 10:20",username/homedir/etc/username.tld/example,/backup/weekly/2017-09-24/accounts/another.tar.gz,2151,1934
0,"2012-11-21 10:20",username/homedir/etc/example,/backup/weekly/2017-09-24/accounts/username.tar.gz,2151,1934
4,"2017-08-23 12:18",username/homedir/accounts/username/homedir/etc/example,/backup/weekly/2017-09-24/accounts/username.tar.gz,2151,1934

 

Additional documentation

  • No labels