Like many other user of LXD, I have been making backup of my container using lxd image technic, now I am converting to lxc export.
I was looking at the api backup doc and also at the backup code inside lxdMosaic, and was wandering how could I do the same from the command line?, or is there some config setting I could use ?
lxc export is one option for command line.
Another idea would be to use snapshots, with lxc snapshot.
Afaik you can also automate backups with snapshots.
Yes I do have automatique snapshot running on my server and auto expired.
I do make use of lxc export every night, lxc copy also.
My question was regarding the /1.0/instances/<name>/backups API.
This is someting that I try to understand and would like to use, I do not want to use third party tools “ex: LxdMosaic backup” if I do not know how it works.
I mean you mention LXDMosaic but can I ask why you aren’t happy with the LXDMosaic solution?
To simplify LXDMosaic;
You just want to write cron jobs to hit POST /1.0/INSTANCE/backups then GET /1.0/INSTANCE/backups/BACKUP_NAME/export then DELETE /1.0/INSTANCE/backups/BACKUP_NAME
Flags:
-d, --data Input data
–raw Print the raw response
-X, --request Action (defaults to GET) (default “GET”)
–wait Wait for the operation to complete
Global Flags:
–debug Show all debug messages
–force-local Force using the local unix socket
-h, --help Print help
–project string Override the source project
-q, --quiet Don’t show progress information
-v, --verbose Show all information messages
–version Print version number Error: Invalid number of arguments
We’ve not yet had much use for exposing all the capabilities of the backups API in the CLI. Instead we just have lxc export and lxc import which make use of it.
lxc export just creates a new backup, then downloads it, then deletes it, pretty much exactly as you did above through lxc query.