Snapshots are a great way to back up your instance in case the unthinkable happens. These can be initiated manually, but Civo also offers automated snapshots which will automatically update based on any schedule you like.

What are Automated Snapshots

A ‘one-off’ snapshot will save a copy of your instance at a single point in time. This snapshot could then be used to restore your instance if anything goes wrong. After completing a significant piece of work on your instance, you may like to initiate another snapshot. If you give it the same name, it will overwrite the first, leaving you with a single snapshot containing the latest instance data.

Automated snapshots work in much the same way, but without the need to manually initiate each new snapshot. They can be set to update based on a specific schedule, for example, every night at midnight. In this case, every night Civo would take a snapshot of your instance to replace the previous version, ensuring the back-up of your instance is never too far behind the real thing.

How to Set Up an Automated Snapshot

Setting up an automated snapshot is easy:

  1. Navigate to your instances page.

  2. Click the snapshot button beside the instance you want to snapshot.

  3. Click the ‘Automated’ button in the pop-up box.

  4. Enter a name for your new snapshot, and the schedule on which you would like it to run in cron format (cron format discussed further below), and click Snapshot

At this point you will be directed to your snapshots page where you can see the state of your new snapshot. An automated snapshot will show as pending until its first execution, after which it will show as completed, but will continue to update based on its schedule (a new completion time is shown after each update).

Want to be told when your snapshot completes? This can be achieved easily, using Civo’s webhooks feature. Find out more about webhooks here.

Cron Format

An automated snapshot’s schedule is required to be specified in cron format, a simple yet powerful method for defining time and frequency.

Although some variations to the standard cron format exist, Civo requires the traditional cron layout as shown below:

<Minute> <Hour> <Day_of_the_Month> <Month_of_the_Year> <Day_of_the_Week>

Each of these five fields are separated by a space and can be represented by: - an asterisk (indicating no restriction on this field, i.e. all values are possible); - a numerical value, a list of numerical values, or a range of numerical values (indication the values possible); or - either of the above, followed by a '/' and another numerical value (indicating the interval between possible values).

Example 1: "0 0 * * 3" would indicate an action each Wednesday at midnight.

Example 2: "45 17 7 6 *" would indicate an action on 7 June at 17:45.

Example 3: “* 0-11 * * *” would indicate an action every minute before midday

Example 4: “0 0 1 */2 *” would indicate an action at midnight on the first day of every second month