Creates a backup for one, several, or all database tables.
backup directorycan be on a local disk to the server, on a remote disk, or a remote filesystem. QuestDB will enforce that the backup are only written in a location relative to the
backup directory. This is a security feature to disallow random file access by QuestDB.
The tables will be written in a directory with today's date. By default, the format is
yyyy-MM-dd, for example
If you would like to use a custom format, you can define it using the following configuration key
cairo.sql.backup.dir.datetime.format like the example below
The data and meta files will be written following the db directory structure
'backup directory/' 2020-04-20 ├── table1 ├── table2 └── ...
If a user performs several backups on the same date, each backup will be written a new directory. Subsequent backups on the same date will look as follows:
'backup directory/' ├── 2020-04-20 'first' ├── 2020-04-20.1 'second' ├── 2020-04-20.2 'third' ├── 2020-04-21 'first new date' ├── 2020-04-21.1 'first new date' └── ...
Backup - Single table
BACKUP TABLE myTable;
Backup - Multiple table
BACKUP TABLE table1, table2, table3;
Backup - All tables