Kaspersky Standard | Plus | Premium

How to manage objects in Backup using the command line

You can use the Backup management commands in the command line for the following actions on Backup objects:

  • View Backup object details.
  • Delete some or all objects from Backup.
  • Restore objects from Backup.

Restoring infected objects may lead to a device infection.

Viewing Backup object details

To view the details of the objects in Backup, run:

kfl-control -B --query ["<filter conditions>"] [-n <number>] [--json]

where:

  • <filter conditions>: one or several logical expressions in the format <field> <comparison operator> '<value >', combined with the help of the logical operator and to limit the results. If you do not specify any filter conditions, the application will display the details of all objects in Backup.
  • <number>: the number of the most recent objects to display. If you do not specify the -n switch, the last 30 objects will be displayed. Specify 0 to show all objects.
  • --json: output data in JSON format.

The ObjectId line displays the numeric identifier that the application assigned to the object when placing it in Backup. This ID is used to perform actions on the object, such as restoring or removing the object from the Backup storage.

Restoring objects from Backup

To restore an object under its original name to its original location, execute the following command:

kfl-control --restore <object ID>

where <object ID> is the numeric identifier that the application assigned to the object when placing it in Backup.

To restore an object under a new name to a specified directory, execute the following command:

kfl-control --restore <object ID> --file <file path>

where --file < file path> is the new name of the file and the path to the directory you want to save it to. If the specified directory does not exist, the application creates it.

If you do not specify a new file name and a new directory, the file is restored with its original name to the original directory.

Deleting objects from Backup

To remove selected objects from Backup, run:

kfl-control --mass-remove --query "<filter conditions>"

where <filter conditions> is one or several logical expressions in the format <field> <comparison operator> '<value>', combined with the help of the logical operator and to limit the results.

Examples:

To remove an object with ID=15:

kfl-control -B --mass-remove --query "ObjectId == '15'"

To remove objects that contain "test" in their names or paths:

kfl-control -B --mass-remove --query "FileName like '%test%'"

To remove all objects from Backup, run:

kfl-control -B --mass-remove