Skip to content

Commit

Permalink
Add backup tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasyu888 committed Oct 27, 2023
1 parent 5ec6762 commit 18ad8d0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions admin/backup.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- This is a scheduled task to create backup databases only for sysadmins
use role accountadmin;

use schema synapse_data_warehouse.synapse;
create task if not exists backup_synapse_data_warehouse_task
schedule = 'USING CRON 0 3 * * 0 America/Los_Angeles'
user_task_managed_initial_warehouse_size = 'XSMALL'
as
create or replace database backup_synapse_data_warehouse
clone synapse_data_warehouse;
alter task if exists backup_synapse_data_warehouse_task resume;
use schema sage.portal_raw;
create task if not exists backup_sage_task
schedule = 'USING CRON 0 3 * * 0 America/Los_Angeles'
user_task_managed_initial_warehouse_size = 'XSMALL'
as
create or replace database backup_sage
clone sage;
alter task if exists backup_sage resume;

0 comments on commit 18ad8d0

Please sign in to comment.