SYSCS_UTIL.SYSCS_SCHEDULE_DAILY_BACKUP

You can use the SYSCS_UTIL.SYSCS_SCHEDULE_DAILY_BACKUP to schedule a full or incremental backup job that runs at a specified time each day.

You specify the scheduled start hour of the backup in Greenwich Mean Time (GMT).

Note that you can subsequently cancel a scheduled backup job with the Backing Up and Restoring topic.

Syntax

SYSCS_UTIL.SYSCS_SCHEDULE_DAILY_DATABASE(
               VARCHAR backupDir,
               VARCHAR(30) backupType,
               INT startHour
               );

backupDir

Specifies the path to the directory in which you want the backup stored. This can be a local directory if you’re using the standalone version of Splice Machine, or a directory in your cluster’s file system (HDFS or MapR-FS).

You must have permissions set properly to use cloud storage as a backup destination. See Backing Up to Cloud Storage in the Administrator’s Guide for information about setting backup permissions properties.

Relative paths are resolved based on the current user directory. To avoid confusion, we strongly recommend that you use an absolute path when specifying the backup destination.

backupType

Specifies the type of backup that you want performed. This must be one of the following values: 'full' or 'incremental'; any other value produces an error and the backup is not run.

Note that if you specify 'incremental', Splice Machine checks the   SYS.SYSBACKUP table to determine if there already is a backup for the system; if not, Splice Machine will perform a full backup, and subsequent backups will be incremental.

startHour

Specifies the hour (0-23in GMT at which you want the backup to run each day. A value less than 0 or greater than 23 produces an error and the backup is not scheduled.

SQL Examples

The following example schedules a daily incremental backup that runs at 3 am (GMT) and gets stored in the hdfs:///home/backup/ directory:

splice> CALL SYSCS_UTIL.SYSCS_SCHEDULE_DAILY_BACKUP('hdfs:///home/backup', 'incremental', 3);
Statement executed;

The following example schedules the same backup and stores it on AWS:

splice> CALL SYSCS_UTIL.SYSCS_SCHEDULE_DAILY_BACKUP('s3://backup1234', 'incremental', 3);
Statement executed.

And this example schedules a daily backup at 6pm (GMT) on a standalone version of Splice Machine:

splice> CALL SYSCS_UTIL.SYSCS_SCHEDULE_DAILY_BACKUP('./dbBackups', 'full',18);
Statement executed.

See Also