Skip to content

Latest commit

 

History

History
70 lines (43 loc) · 2 KB

README.md

File metadata and controls

70 lines (43 loc) · 2 KB

Latest Stable Version Total Downloads Monthly Downloads

OVH VPS Automated Snapshot

Requirements

Installation

composer create-project spartakusmd/ovh-vps-snapshot

Configuration

First step

Create credentials by clicking here !

Depending on the account zone, the domain may be needed to be customised. Check Supported APIs.

The script requires access to the following API endpoints.

  • GET: /vps/*
  • GET: /vps/*/snapshot
  • DELETE: /vps/*/snapshot
  • GET: /vps/*/tasks/*
  • POST: /vps/*/createSnapshot

Second step

Create snapshot.yml in root directory with your credentials and the list of your instances/volumes :

---
applicationKey: <ovh_application_key>
applicationSecret: <ovh_application_secret>
consumerKey: <ovh_consumer_key>

apiEndpoint: ovh-eu

vps:
  - "vps123456.ovh.net"
  - "vps452689.ovh.net"

Run

php snapshot.php

Dry-run mode (simulates the query) :

php snapshot.php --dry-run

Crontab

You can automate the snapshot creation by creating a crontab making a call to this tool.

Daily:

30 3 * * * php /opt/ovh-vps-snapshot/snapshot.php >> /var/log/ovh-vps-snapshot.log

Each Tuesday:

30 3 * * 2 php /opt/ovh-vps-snapshot/snapshot.php >> /var/log/ovh-vps-snapshot.log