backupDB
New in version 1.30.20.
Syntax
backupDB(backupDir, dbPath)
Arguments
backupDir is a string indicating the directory to save the backup.
dbPath is a string indicating the database path.
Details
Back up the entire database to the specified directory.
The function is equivalent to backup(backupDir, dbPath, force=false, sparallel=true, snapshot=true)
.
Examples
$ dbName = "dfs://compoDB2"
$ n=1000
$ ID=rand("a"+string(1..10), n)
$ dates=2017.08.07..2017.08.11
$ date=rand(dates, n)
$ x=rand(10, n)
$ t=table(ID, date, x)
$ db1 = database(, VALUE, 2017.08.07..2017.08.11)
$ db2 = database(, HASH,[INT, 20])
$ if(existsDatabase(dbName)){
$ dropDatabase(dbName)
$ }
$ db = database(dbName, COMPO,[ db1,db2])
//create 2 tables
$ pt1 = db.createPartitionedTable(t, `pt1, `date`x).append!(t)
$ pt2 = db.createPartitionedTable(t, `pt2, `date`x).append!(t)
$ backupDB(backupDir, dbName)
Related functions: backup, backupTable, restore, restoreDB, restoreTable, migrate