composer create-project spartakusmd/ovh-vps-snapshot
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
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"
php snapshot.php
Dry-run mode (simulates the query) :
php snapshot.php --dry-run
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