Schedules

Schedules

Schedules are where the magic happens at SnapShooter, we have always aimed to make them as easy as possible to use while remaining flexible.

You can't directly create schedules but you can modify them.

Depending on your plan you might have different options around what is possible.

Example Schedule Object

{
"id": 4,
"schedule_name": "main",
"schedule_order": 0,
"status": "active",
"frequency": 24,
"frequency_mode": "hour",
"cron": "0 * * * *",
"timezone": "UTC",
"run_offset": 0,
"retention": {
"hourly": 0,
"daily": 1,
"weekly": 0,
"monthly": 0
},
"resource_type": "BackupJob",
"resource_id": "127906c7-4599-4d87-94b0-33c9a45c7ea8"
}

You can see the schedule id, this can be used when trying to update it.

Creating Schedule as part of Job Creation

Hour Mode

The most common mode for setting up backups allow you to pick from hourly to every 24h.

With this mode, you can set up hourly, daily, weekly and monthly retention rules. The hourly tag will apply to every backup in this mode due to being taken on the hour.

The frequency will be prefixed with an 'h'. E.g. 'h24' for every 24 hours and `h2` for every two hours. Allowable values are fractions of 24h. 24, 12, 6, 4, 3, 2, 1.

Run offset allows you to shift the starting point of the cycle from midnight in the timezone you scheduled.

UTC, run offset 3, frequency h6. This will lead to backups running at 3 am, 9 am, 3 pm, 9 pm. With the 3 am backup tagged as the daily.

{
"order": 0,
"timezone": "UTC",
"retention_hourly": 7,
"retention_daily": 7,
"retention_weekly": 7,
"retention_monthly": 7,
"frequency": "h24",
"run_offset": 5
}

Minute Mode

If you want to run a backup more often than hourly you can use the minute mode.

The frequency will be prefixed with an 'm'. E.g. 'm30' for every 30 minutes. Allowable values are fractions of 60. 30, 20, 15, 10, 6, 5.

Currently, we don't support more frequent than every 5 minutes.

When backups are taken on the hour we tag that as the hourly backup. You can still use the run_offet for deciding which backup will be the daily tagged backup.

{
"order": 0,
"timezone": "UTC",
"retention_hourly": 7,
"retention_daily": 7,
"retention_weekly": 7,
"retention_monthly": 7,
"frequency": "m30",
"run_offset": 5
}

Cron Mode

Example payload using cron, note the frequency mode is set to cron. When using cron only a single retention policy can be used. You must provide all of the following fields.

Run offset will be ignored and backups will not get tagged daily, weekly and monthly.

{
"order": 0,
"timezone": "UTC",
"retention": 7,
"cron": "0 * * * *",
"frequency": "cron"
}

Errors

If your team does not support cron you will receive a validation error.

{
"message": "The given data was invalid.",
"errors": {
"schedules.0.frequency": [
"Please upgrade to support cron"
]
}
}

Too often:

{
"message": "The given data was invalid.",
"errors": {
"schedules.0.cron": [
"Cron can't be scheduled more frequency than every 5 minutes"
]
}
}


Was this page helpful?

Thank you for helping us improve!