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.