Backup Operations
DRLM backup operations allow us to remotely create new backups of clients, enable and disable restore points and make listings of backups created among other things.
Run Backup
This command is used to Run remote client backup from DRLM. It is called like this:
~# drlm runbackup [options]
The drlm runbackup has several options:
- -c client_name, --client client_name
Select Client to remotely run backup by name.
Examples:
~# drlm runbackup -c clientHost1 ~# drlm runbackup --client clientHost1
- -I client_id, --id client_id
Select Client to remotely run backup by ID.
Examples:
~# drlm runbackup -I 12 ~# drlm runbackup --id 12
- -C config_name, --config config_name
Since DRLM 2.4.0 it is possible to have multiple configurations for each Client. The configurations must be in /etc/drlm/clients/client_name.cfg.d/ path and with .cfg extension (ex.: home_backup.cfg). With -C parameter is possible to select witch client backup configuration will be used. If is not especified, default configuration /etc/drlm/clients/client_name.cfg will be used
Examples:
~# drlm runbackup -c clientHost1 -C home_backup ~# drlm runbackup --id 12 --config home_backup
- -S
Scan for infected files after the backup is completed
Examples:
~# drlm runbackup -c clientHost1 -S
Note
This option is available on Enterprise Edition
Help option:
- -h, --help
Show drlm runbackup help.
Examples:
~# drlm runbackup -h ~# drlm runbackup --help
Restore Backup
This command is used to restore backups from DRLM. It is called like this:
~# drlm restore [options]
Warning
This operation only works with backups of type DATA using RSYNC. You may need to enable desired backup to restore, see List Backups Backup Manager.
The drlm restore has several options:
- -c client_name, --client client_name
Select Client to remotely run restore by name.
Examples:
~# drlm restore -c clientHost1 ~# drlm restore --client clientHost1
- -I client_id, --id client_id
Select Client to remotely run restore by ID.
Examples:
~# drlm restore -I 12 ~# drlm restore --id 12
- -C config_name, --config config_name
Since DRLM 2.4.0 it is possible to have multiple configurations for each Client. The configurations must be in /etc/drlm/clients/client_name.cfg.d/ path and with .cfg extension (ex.: home_backup.cfg). With -C parameter is possible to select witch client backup configuration will be used. If is not especified, default configuration /etc/drlm/clients/client_name.cfg will be used
Examples:
~# drlm restore -c clientHost1 -C home_backup ~# drlm restore --id 12 --config home_backup
- -f /path/to/file.txt,/path/to/dir/, --files /path/to/file.txt,/path/to/dir/
Select comma separated list of files/dirs to restore (no regex!).
Examples:
~# drlm restore -c clientHost1 -C home_backup -f /home/user1/,/home/user3/Desktop/image.jpg ~# drlm restore --id 12 --config home_backup --files /home/user2
- -O, --overwrite
Overwrite files to original path. Use it with caution!.
Danger
By default, all restores will be done in /var/tmp/drlm/restored/ directory on clients. Using this option will Overwrite data on destination client, so be careful!
Examples:
~# drlm restore -c clientHost1 -C home_backup -O ~# drlm restore --id 12 --config home_backup --files /home/user2 --overwrite
Help option:
- -h, --help
Show drlm restore help.
Examples:
~# drlm restore -h ~# drlm restore --help
Tip
You can restore data backups from a client using: rear restorefiles. Specific files/dirs can be retrieved from the enabled DRLM backup: rear restorefiles FILES_TO_RECOVER=/home/user1,/home/user3/image.jpg. All restored files will be in /var/tmp/drlm/restored/.
Delete Backup
This command is used to delete backups from DRLM database. It is called like this:
~# drlm delbackup [options]
Warning
To remove a backup, it must be disabled.
The drlm delbackup has some required options:
- -c client_name, --client client_name
Select Client to delete the backups.
- -I backup_id, --id backup_id
Select Backup to delete by ID.
- -A, --all
Delete All backup.
Examples:
~# drlm delbackup -I 1.2015030121245 ~# drlm delbackup --id 1.2015030121245 ~# drlm delbackup -c clientHost1 -A ~# drlm delbackup --client clientHost1 --all
Help option:
- -h, --help
Show drlm delbackup help.
Examples:
~# drlm delbackup -h ~# drlm delbackup --help
List Backups
This command is used to list the backups that we have stored on the server. It is called like this:
~# drlm listbackup [options]
The drlm listbackup has some options:
- -c client_name, --client client_name
Select Client to list its backups.
Examples:
~# drlm listbackup -c clientHost1 ~# drlm listbackup --client clientHost1
- -A, --all
List all backups. This option is set by default if any option is specified.
Examples:
~# drlm listbackup ~# drlm listbackup -A ~# drlm listbackup --all
- -p, --pretty
Marks those backups that might have failed with colors. By default, it colors in red the backups that are less than 200MB or that took less than 60 seconds to complete. Also, it colors in yellow the backups that are less than 800MB or that took less than 120 seconds. These values can be changed in the configuration with the following configurations:
BACKUP_SIZE_STATUS_FAILED="200" BACKUP_SIZE_STATUS_WARNING="800" BACKUP_TIME_STATUS_FAILED="60" BACKUP_TIME_STATUS_WARNING="120"
Note
This option is enabled by default. It can be disabled by setting DEF_PRETTY=false in /etc/drlm/local.conf.
Examples:
~# drlm listbackup -p ~# drlm listbackup -c clientHost1 --pretty ~# drlm listbackup --pretty
- -P, --policy
List backups showing the policy used to keep the backup. The policy is defined in the configuration file of the client.
Examples:
~# drlm listbackup -P ~# drlm listbackup -c clientHost1 --policy ~# drlm listbackup --policy
Help option:
- -h,--help
Show this help
Examples:
~# drlm listbackup -h ~# drlm listbackup --help
Backup Manager
This command is used to enable or disable client restore points. Is also used to set a restore point by default. It is called like this:
~# drlm bkpmgr [options]
The drlm bkpmgr has some required options:
- -I backup_id, --id backup_id
Select Backup ID to modify
- -e, --enable
Enable Backup
- -d, --disable
Disable Backup
- -w, --write
Enable Backup in local write mode (WARNING! Snaps in write mode are not allowed)
- -W, --full-write
Enable Backup in local and remote write mode (WARNING! Snaps in write mode are not allowed)
- -H, --hold-on, --hold-off
Hold backup. If a backup is holded means that will be ignored after a drlm runbackup when old backups are cleaning
Examples:
~# drlm bkpmgr -I 1.20140519065512 -e ~# drlm bkpmgr -I 1.20140519065512 -d ~# drlm bkpmgr --id 1.20140519065512 -e
Help option:
- -h, --help
Show drlm bkmgr help.
Examples:
~# drlm bkmgr -h ~# drlm bkmgr --help
Export/Import Backups
Since version 2.1.0 the possibility to import or export backups from other DRLM servers has been added. To export a backup:
Export Backups
This command is used to export a backup that we have stored on the server. It is called like this:
~# drlm expbackup [options]
The drlm expbackup has the following required options:
- -I backup_id, --id backup_id
Enter the backup ID you would like to export.
- -f destination_file, --file destination_file
Enter the output path in which you would like to export the backup,
Examples:
~# drlm expbackup -I 2.20170125103105 -f /tmp/export.dr
You could now save or copy the exported backup to another DRLM server.
Help option:
- -h, --help
Shows help menu.
Examples:
~# drlm expbackup -h ~# drlm expbackup --help
Import Backups
This command is used to import a backup that we have received from other DRLM server or to import backup between clients. It is called like this:
~# drlm impbackup [options]
The drlm impbackup has the following required options:
- -c client_name, --client client_name
You need to first register the client in the database before importing an exported DRLM backup.
- -f file, --file file
Set the destination path of the backup to import.
Examples:
~# drlm impbackup --client rear-debian -f /tmp/export.dr
- -I backup_id, --id backup_id
Import the backup from a backup of the same server
Examples:
~# drlm impbackup --client rear-debian -I 105.20190211083744
- -i, --import-config
If import-config is specified impbackup will also import the backup configuration.
- -C config_name, --config config_name
Since DRLM 2.4.0 it is possible to have multiple configurations for each Client. The configurations must be in /etc/drlm/clients/client_name.cfg.d/ path and with .cfg extension (ex.: home_backup.cfg). With -C parameter is possible to select witch client backup configuration will be used. If is not especified, default configuration /etc/drlm/clients/client_name.cfg will be used
Examples:
~# drlm impbackup --client rear-debian -f /tmp/only_data.dr -t 0 -C Home_Backup ~# drlm impbackup --client rear-debian -f /tmp/ISO_backup.dr -t 2 -C ISO_Backup_Recovery
Help option:
- -h, --help
Shows help menu.
Examples:
~# drlm expbackup -h ~# drlm expbackup --help
Backup Job Scheduler
Since version 2.1.0 backup tasks can be scheduled. The drlm backup scheduler allows you to add, list and delete scheduled jobs. You can also enable or disable the schedule function (by default it is enabled). You can set backup operations to run on a specified date and time by running:
Add Jobs
This command is used to plan backup jobs in DRLM. It is called like this:
~# drlm addjob [options]
Required options:
- -c client_name, --client client_name
Client for which you want to run a scheduled backup.
- -s start_date, --start_date start_date
Start date and time for the scheduled backup. Format: YYYY-MM-DDTHH:MM
Optional arguments:
- -e end_date, --end_date end_date
End date and time for the scheduled backup. Format: YYYY-MM-DDTHH:MM
- -r repeat_time, --repeat repeat_time
This argument specifies the time a backup will be performed between the start and the end date of a scheduled backup (if any end_date is set). You can specify the repeating pattern in min(s) or minute(s), hour(s), day(s), week(s), month(s) and year(s).
- -C config_name, --config config_name
Since DRLM 2.4.0 it is possible to have multiple configurations for each Client. The configurations must be in /etc/drlm/clients/client_name.cfg.d/ path and with .cfg extension (ex.: home_backup.cfg). With -C parameter is possible to select witch Client backup configuration will be used. If is not especified, default configuration /etc/drlm/clients/client_name.cfg will be used
Examples:
~# drlm addjob -c rear-debian -s 2017-01-30T21:00 ~# drlm addjob -c rear-debian -s 2017-01-30T21:00 -C home_backup ~# drlm addjob --client rear-centos -s 2017-02-03T08:00 -e 2017-02-05T23:00 -r 1hour ~# drlm addjob --client rear-centos -s 2017-02-03T08:00 -e 2017-02-05T23:00 -r 1hour --config home_backup
Help option:
- -h, --help
Shows help menu.
Examples:
~# drlm addjob -h ~# drlm addjob --help
List Jobs
This command is used to list backup jobs planned in DRLM. It is called like this:
~# drlm listjob [options]
- -I job_id, --job_id job_id
To list a job by its ID.
- -c client_name, --client client-name
To list all the jobs scheduled for a specific client.
Examples:
~# drlm listjob ~# drlm listjob -c rear-suse ~# drlm listjob --job_id 3
Help option:
- -h, --help
Shows help menu.
Examples:
~# drlm listjob -h ~# drlm listjob --help
Delete Jobs
This command is used to delete planned backup jobs in DRLM. It is called like this:
~# drlm deljob [options]
- -c client_name, --client client_name
To delete all scheduled jobs for a specific client.
- -I job_id, --job_id job_id
To delete a specific scheduled backup job.
Examples:
~# drlm deljob -I 5 ~# drlm deljob -c rear-centos
Help option:
- -h, --help
Shows help menu.
Examples:
~# drlm deljob -h ~# drlm deljob --help
Scheduler Management
With this command you can enable or disable the job scheduler facility, enable or disable an individual job or force to run jobs planned at “now” by running:
drlm sched [options]
- -e, --enable
Enables job scheduler utility or and individual job if Job ID is specified.
- -d, --disable
Disables job scheduler utility or and individual job if Job ID is specified.
- -r, --run
Runs all planned jobs (starting from the nearest date).
Examples:
~# drlm sched -e ~# drlm sched -e -I 25 ~# drlm sched -r
Help option:
- -h, --help
Shows help menu.
Examples:
~# drlm sched -h ~# drlm sched --help
Scan Backup
This command is used to scan for infected files on an existing backup. It is called like this:
~# drlm scan [options]
The drlm scan has some required options:
- -I backup_id, --id backup_id
Select Backup ID to scan
- -c, --client
Scan enabled backup
Examples:
~# drlm scan -I 1.20140519065512 ~# drlm scan -c rear-centos
Help option:
- -h, --help
Show drlm scan help.
Examples:
~# drlm scan -h ~# drlm scan --help
Note
This feature is available only for DRLM Enterprise.