Script for automated incremental backups
Last updated
Last updated
This script demonstrated in this tutorial will use public cloud APIs to communicate with the cloud and generate volume backups for all instances. You can follow the instructions to set up this script on crontab. With the help of crontab, it will run automatically every day. On the first run, this script will generate full-volume backups of all the VMs. After the first day, it will take incremental backup for 20 days. On the 21st day, the script will remove all the volume backups and generate a full volume back up again, so the cycle repeats itself every 20 days. These settings are customizable; if you need any other settings, you can open a ticket by clicking here.
There are some prerequisites that need to be met before you begin:
Python 3
Instance on Public Cloud console
Step 1: You have to create an instance first. Follow this article to create an instance.
Step 2: Download and unzip files by clicking here. This folder contains two files, variable.json
, and script.py.
Please change the following fields in the variables.json
file:
Field | Description |
---|---|
Upload both variable.json
and script.py
on your server.
Step 3: Set the execution of the script in cron.
When you run the above command, a file will open; add the follow line to schedule volume backup at 1:00 every day.
Region
Change the value of the region 'ap-south-mum' to operate and maintain your backups in the Mumbai region.
Project ID
Mention your project id here; you can find it on the dashboard panel.
Name
Mention your cloud console username here.
Password
Mention your cloud console password here.
Name
Mention the name of your project here; you can find it on the dashboard panel under identity.