spartakusmd/ovh-vps-snapshot

OVH VPS Automated Snapshot (via OVH API)

1.0.1 2018-12-18 12:02 UTC

This package is auto-updated.

Last update: 2024-04-19 00:31:14 UTC


README

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