profitbricks-snapshot is a tool to create daily block based images of virtual machines in the Profitbricks private cloud. It also deletes snapshots that are older than a defined retention time in days.
-
Get profitbricks-snapshot:
git clone https://github.com/seibert-media/profitbricks-snapshot.git
-
Install python requirements:
pip install -r requirements.txt
-
Create and adjust your settings:
cp settings.cfg.example settings.cfg
-
Execute profitbricks-snapshot every day via cron:
crontab -e
0 3 * * * cd /path/to/profitbricks-snapshot && python profitbricks-snapshot.py
Example settings.cfg:
[credentials]
username: user@domain.com
password: secret
[snapshots]
datacenter_id: abc12345a-12ab-3a4b-1a23-1ab2cd345e67
snapshot_prefix: AUTOSNAP
retention_time: 7
sleep_seconds: 60
-
credentials: Username and password of your Profitbricks account.
-
datacenter_id: All volumes in this datacenter will be snapshotted.
-
snapshot_prefix: Prefix string of snapshot names. Name of snapshots from example: "AUTOSNAP-YYYMMDD-VOLUMENAME"
-
retention_time: Retention time in days. Older snapshots will be deleted.
-
sleep_seconds: Number of seconds to wait between the creation of snapshots.
python profitbricks-snapshot.py
This project is licensed under the terms of the MIT license.