Snapshot Management in Gaia Clish - Scheduled Snapshots
Before you create a snapshot image, make sure the appliance or storage destination meets the prerequisites.
Description
Manage system images (snapshots).
From R81, you can also configure scheduled system images (snapshots).
|
Notes:
|
Syntax
|
|
|
|
|
Procedure
-
Configure the scheduled snapshot task
R81 supports only one of these scheduled snapshot tasks.
You can only configure one task for a local LVM volume, one task for an FTP server, or one task for an SCP server.
Creating a new snapshot image as a local LVM volumeset snapshot-scheduled settings snapshot-name-prefix <Prefix of Snapshot Name> [description "<Description of Snapshot>"] target lvm
Note - Gaia Check Point security operating system that combines the strengths of both SecurePlatform and IPSO operating systems. Snapshots are not files, but Logical Volume Management (LVM) volumes. Gaia stores these snapshots as a disk partition. To show the list of virtual drives, run the "
lvs
" command in the Expert mode.Creating a new snapshot image as a file and uploading it to an SCP serverset snapshot-scheduled settings snapshot-name-prefix <Prefix of Snapshot Name> [description "<Description of Snapshot>"] target scp ip <IPv4 Address of SCP Server> path <Path on SCP Server> username <User Name on SCP Server> {password <Password in Plain Text> | password-hash <Password Hash>}
Important:
-
First, you must follow sk164234 to configure the SCP server as a trusted host on Gaia.
-
The username must have permissions to delete files on the SCP server.
Creating a new snapshot image as a file and uploading it to an FTP serverset snapshot-scheduled settings snapshot-name-prefix <Prefix of Snapshot Name> [description "<Description of Snapshot>"] target ftp ip <IPv4 Address of FTP Server> path <Path on FTP Server> username <User Name on FTP Server> {password <Password in Plain Text> | password-hash <Password Hash>}
Important -The username must have permissions to delete files on the FTP server.
-
-
Configure the recurrence for the snapshot scheduleRunning one time on each day at specified time
set snapshot-scheduled recurrence daily time <HH:MM>
Running in specified months on specified days and at specified timeset snapshot–scheduled recurrence monthly month {<Months> | all} days <Days> time <HH:MM>
Running each week on specified days of week and at specified timeset snapshot-scheduled recurrence weekly days {<Days> | all} time <HH:MM>
-
Configure the snapshot retention policy
Important:
-
This step applies only if you save the new snapshot image as a local LVM volume.
-
The retention policy applies only to the new snapshots (and does not apply to existing snapshots).
-
When Gaia creates new snapshots, it deletes the oldest snapshot that exceeds the configured policy parameters.
Configuring the maximum number of snapshot images to saveset snapshot-scheduled retention-policy max-snapshots-to-keep <1-9999>
Configuring the minimum number of snapshot images to saveset snapshot-scheduled retention-policy min-snapshots-to-keep <1-9999>
Configuring the amount of free disk space to maintainThis command lets you configure how much of the disk space must remain free at all times:
set snapshot-scheduled retention-policy keep-disk-space-above-in-GB <Limit>
The limit you need to configure with this command is:
Limit = (Available free disk space for all snapshot images) - (Free disk space to maintain)
Where:
Available free disk space for all snapshot images =
= (Output of: vgdisplay | grep Free) - 1.1*(Output of: lvs | egrep "LSize|lv_current")
ExampleFor more information, see sk80260.
-
Log in to the Expert mode.
-
Get the free disk space in volume groups:
[Expert@MyGaia:0]# vgdisplay | grep Free Free PE / Size 4090 / 127.81 GiB [Expert@MyGaia:0]#
-
Get the free disk space in the "
lv_current
" partition:[Expert@MyGaia:0]# lvs | egrep "LSize|lv_current" LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert lv_current vg_splat -wi-ao---- 40g [Expert@MyGaia:0]#
-
Calculate the free disk space available for snapshot images:
Available free disk space for all snapshot images =
= (Output of "vgdisplay" command) - 1.1*(Output of "lvs" command) =
= (127.81) - 1.1*(40) = 83.81 GB
-
Calculate the limit for the scheduled snapshot task:
For example, you need to maintain 30 GB of free disk space at all times.
Limit = (Available free disk space for all snapshot images) - (Free disk space to maintain) =
= (83.81 GB) - (30 GB) = 53.81 GB
-
Configure the limit (round up or round down the limit you calculated in the previous step):
set snapshot-scheduled retention-policy keep-disk-space-above-in-GB 54
save config
-
-
Enable the scheduled snapshot feature
-
To control this feature in Gaia Clish:
-
To enable the snapshot schedule:
set snapshot-scheduled activation enabled
Important:
-
You must run this command after you configure a scheduled snapshot for the first time.
-
You must run this command after any change in the existing configuration of a scheduled snapshot.
-
-
To disable the snapshot schedule:
set snapshot-scheduled activation disabled
-
-
To control this feature in Gaia Portal:
-
In the navigation tree, click Maintenance > Snapshot Management.
-
In the section Scheduled Snapshots:
-
To enable the snapshot schedule, select Activate / Deactivate.
-
To disable the snapshot schedule, clear Activate / Deactivate.
-
-
Click Apply.
-
-
-
Examine the scheduled snapshot configuration
show snapshot-scheduled
You can only disable the snapshot schedule to stop the scheduled task:
|
|
Important - After you add, configure, or delete features, run the " |
Parameter |
Description |
||
---|---|---|---|
|
The final name of the snapshot consists of two parts - the prefix (configured by the user) and the time stamp (format is hard-coded):
|
||
|
Optional. Configures the description of the snapshot image. You must enclose the text in double quotes, or enter the string that does not contain spaces. Default description : |
||
|
Specifies the destination for the snapshot image:
|
||
|
Specifies the IPv4 address of the remote server:
|
||
|
Specifies the path to the snapshot image file:
|
||
|
Specifies the login username on the remote server:
|
||
|
Specifies the password (in plain text) required to log in to the remote server. |
||
|
Specifies the hash of the password required to log in to the remote server. |
||
|
Specifies that the job should run once a day - every day, at specified time. Enter the time of day in the 24-hour clock format - <Hours>:<Minutes>.
|
||
|
Specifies that the job must run once a month - on the specified months, on the specified dates, and at the specified time.
Example:
|
||
|
Specifies that the job must run once a week - on specified days of week, and at specified time.
Example:
|
||
|
Configures the retention policy when you save the new snapshot image as a local LVM volume: (when Gaia creates new snapshots, it deletes the oldest snapshot that exceeds the configured policy parameters)
|
||
|
Enables or disables the snapshot schedule. |
-
Creating a daily snapshot image as a local LVM volume:
gaia> set snapshot-scheduled settings snapshot-name-prefix Daily description "Daily snapshot image" target lvm
gaia>
gaia> set snapshot-scheduled recurrence daily time 22:00
gaia>
gaia> set snapshot-scheduled retention-policy max-snapshots-to-keep 10
gaia>
gaia> set snapshot-scheduled retention-policy min-snapshots-to-keep 3
.gaia>
gaia> set snapshot-scheduled retention-policy keep-disk-space-above-in-GB 50
gaia>
gaia> show snapshot-scheduled
Scheduled snapshot configuration:
name: Daily
description: Daily
activation: disabled
target: lvm
max-snapshots-to-keep: 10
min-snapshots-to-keep: 3
keep-disk-space-above-in-GB: 50
Every day at 22:00
gaia>
gaia> set snapshot-scheduled activation enabled
gaia>
gaia> save config
-
Creating a monthly snapshot image as a file and uploading it to an SCP server:
gaia> set snapshot-scheduled settings snapshot-name-prefix Monthly description "Monthly snapshot image" target scp ip 192.168.20.30 path /var/log/my_snapshots/ username backup_user password 123456
gaia>
gaia> set snapshot-scheduled recurrence monthly month all days 1 time 22:00
gaia>
gaia> show snapshot-scheduled
Scheduled snapshot configuration:
name: Monthly
description: Monthly
activation: disabled
target: scp
username: backup_user
ip: 192.168.20.30
uploadPath: /var/log/my_snapshots/
Every month on day 1 at 22:00
gaia>
gaia> set snapshot-scheduled activation enabled
gaia>
gaia> save config
Troubleshooting
If a scheduled snapshot task fails, there is no notification about it. You must manually check if a snapshot was created.
-
If a snapshot was not created, examine these files:
/var/log/messages*
-
If a snapshot was created, but there were some issues, examine this file:
/var/log/CPsnapshot/<Snapshot Name>_<Timestamp>