github.com/xchangeee/syslet/schema@v0.2.0

addons/backup.cue raw

 1package addons
 2
 3#SysdefBackup: {
 4	backup!: [string]: #SysdefBackupEntry
 5}
 6
 7// backup of one application
 8#SysdefBackupEntry: {
 9	// volume name -> paths inside the volume
10	volumes!: [VolumeName=string]: [...string]
11	// commands the backup system runs around a snapshot
12	snapshotHooks!: #SysdefSnapshotHooks
13	// commands the backup system runs around a restore
14	restoreHooks!: #SysdefRestoreHooks
15}
16
17#SysdefSnapshotHooks: {
18	// commands run before the snapshot
19	pre!: [...string]
20	// commands run after the snapshot
21	// failed
22	post!: [...string]
23}
24
25#SysdefRestoreHooks: {
26	// shell script run in the backup container while the application is stopped,
27	// after its files and database are restored, e.g. to put a restored file in
28	// place
29	postRestoreScript?: string
30	// commands run while the application is stopped, after its files and
31	// database are restored, e.g. to empty its cache
32	offline!: [...string]
33	// commands run after the application is started again
34	online!: [...string]
35}
36
37#SysdefBackupDefaults: {
38	backup: {}
39	backup: [string]: snapshotHooks: pre: *[] | [...string]
40	backup: [string]: snapshotHooks: post: *[] | [...string]
41	backup: [string]: restoreHooks: offline: *[] | [...string]
42	backup: [string]: restoreHooks: online: *[] | [...string]
43}