Backup Database
Based on the database backup configuration on the server, as set by the system admins, you can take the backup of the complete database on a daily, weekly, or monthly basis. Only system admins can access the backup folders and restore them. Backup archive is stored on highly durable NFS share. The following backup archives are available:
-
Archives for the last 7 days
-
Weekly archives for the last 4 weeks
-
Monthly archives for the last 6 months
Note |
You can change the duration for monthly archives. |
Setup Backup
Before you begin
-
Ensure that highly durable 2 TB NFS storage is available to store database archives.
-
Ensure that the storage is accessible from the Cisco ONP environment. Set up rules that are defined by the Cisco ONP network and appropriate ACL (Access Control List) to permit or deny access to the storage.
Procedure
Step 1 |
Log into the Cisco ONP server, where you have installed Cisco ONP by using the tar archive. |
Step 2 |
Create a folder for backup. Ideally it should be mounted on a reliable object storage (like NFS). |
Step 3 |
Copy |
Perform Manual Backup
Perform the following steps for the backup operation:
Procedure
Step 1 |
Browse to the location, where the backup_mongo.sh script is stored. |
Step 2 |
Execute the backup_mongo.sh script using the following command: Example:
The backup file gets stored in the daily backup folder (backup.daily) with the current time stamp. |
Schedule a Backup
Schedule a Backup Using Script
Procedure
Step 1 |
Log in to the Cisco ONP server. |
Step 2 |
Execute the rotation.sh script using the following command:
This command creates necessary folder structure. |
Step 3 |
Execute the setup_backup.sh script using the following command: Example: The backup file gets stored in the daily backup folder (backup.daily) with the current time stamp. |
Step 4 |
Enter the path in the user prompt to store the file.
|
Schedule a Backup
Procedure
Step 1 |
Log in to the Cisco ONP server. |
Step 2 |
Configure the Crontab job using the following command.
|
Step 3 |
Modify the Crontab.sh script to schedule the backup. Example: The following example shows the scheduling of the backup operation, at 3 a.m daily.
|
Syntax to Schedule the Backup Using Crontab
Use the following syntax to schedule backup in Crontab:
m h dom mon dow
Where:
-
m—Minutes (0–59)
-
h—Hours (1–23)
-
dom—Day of the month
-
mon—Month of the year
-
dow—Day of the week
To define the time, you can provide concrete values for minute (m), hour (h), day of the month (dom), month (mon), and day of the week (dow), or use the wildcard, '*' in these fields (for 'any').
Note |
The backup jobs start based on the cron's system daemon's notion of time and time zones. |