A command line interface to restore_infected library is present in the file restore_infected_cli.py. If installed from the RPM, the binary is located in /usr/bin/restore_infected and can be used as “restore_infected”. To use the CLI a backend and an action should be specified.
The library includes the following backup backend plugins:
Where BACKEND is one of the backends - predefined or custom and ACTION is one of the actions described below.
The first step most of the plugins will need is initialization. The most common use of it is to save credentials for the backup server.
The arguments may vary depending on the backend used. To see which arguments are needed for the particular plugin you can call init with no arguments:
To install Acronis backup agent, pass --provision option to init command. To force installation when agent is present use --force option.
list shows available backups sorted by date starting with the newest.
If a date string is passed as --until, list all backups from now up to that date or all backups otherwise. The date for --unitil parameter can be in any format that python-dateutil can parse, e.g. "2017-08-01", "01 Aug 2017", etc.
Restore files from backup. restore takes a list of files (paths to them) which are considered infected, searches for the first uninfected entry of each file in backups and restores it. Backups older than the date set in --until are not considered.
The most common use is to delete any temporary files created by the plugin. Depending on the backend the functionality may vary or such function might not be present at all.
This is for acrivity not connected to restoring from backups.
Currently supported options are
•login_url (for Acronis backend). This option returns url to log in to Acronis cloud web-interface;
•refresh_token (for Acronis backend). This option refreshes authentication token to keep it valid.