Periodic Snapshot Tasks Screens

The Data Protection screen Periodic Snapshot Task widget displays periodic snapshot tasks created on the system. A periodic snapshot task allows scheduling the creation of read-only versions of pools and datasets at a given point in time.

Periodic snapshot tasks display the machine time, browser time, or both, depending on individual user timezone settings. Users can update timezone settings by utilizing the General Settings screen.

Periodic Snapshot Task Widget

The Periodic Snapshot Task widget displays a list of tasks configured on the system. The widget shows a description of periodic snapshot tasks when a task is not configured.

Periodic Snapshot Task Widget without Task
Periodic Snapshot Task Widget with Tasks

The Periodic Snapshot Task widget header opens the Periodic Snapshot Task screen.

Add opens the Add Periodic Snapshot Task screen.

VMware Snapshot Integration opens the VMware Snapshots screen.

Snapshots opens the Snapshots screen.

The vertical ellipses more_vert at the right of the task on the Periodic Task Widget opens a dropdown menu with two task options: Edit and Delete.

The delete Delete opens a delete dialog. Confirm activates the Delete. Delete deletes the saved periodic snapshot task.

Edit opens the Edit Periodic Snapshot Task screen.

State shows the status of the next cloud sync task. It opens a Logs window for that task.

Logs Window

PeriodicSnapshotTaskLog

Download Logs saves a copy of the current task logs.

Periodic Snapshot Task Screen

Periodic snapshot tasks show on both the Periodic Snapshot Task widget on the Data Protection screen and the Periodic Snapshot Tasks screen.

DataProtectionPeriodicSnapshotTasksList

Add opens the Add Periodic Snapshot Task screen.

DataProtectPeriodicSnapshotTasksDetailsNoTasks

The Columns dropdown list shows options to customize the list view. Options are Select All, Recursive, Naming Schema, When, Frequency, Next Run, Keep snapshot for, VMWare Sync, Enabled, State, and Reset to Defaults.

State shows the current state of the task.

The expand_more expand shows the details for the selected task.

DataProtectionPeriodicSnapshotTasksDetails

Edit opens the Edit Periodic Snapshot Task screen.

Delete opens the delete dialog that removes the task from the system.

Add and Edit Periodic Snapshot Screens

The Add Periodic Snapshot Task and Edit Periodic Snapshot Task show the same settings.

Dataset Options

Dataset settings show on both the add and edit configuration screens.

AddPeriodicSnapshotTaskScreen

Dataset Settings
SettingDescription
DatasetSets the pool, dataset, or zvol you want to take a snapshot of.
ExcludeExcludes specific child datasets from the snapshot. Use with recursive snapshots. List paths to any child datasets to exclude. Example: pool1/dataset1/child1. A recursive snapshot of pool1/dataset1 includes all child datasets except child1. Separate entries by pressing Enter.
RecursiveSets the task to take separate snapshots of the dataset and each of its child datasets. Leave the checkbox clear to take a single snapshot only of the specified dataset without child datasets.
Schedule Settings

Schedule settings show on both the add and edit configuration screens.

SettingDescription
Snapshot LifetimeSets the length of time to retain a snapshot on this system. Enter a numeric value and a single lowercase letter for units. Examples: 3h is three hours, 1m is one month, and 1y is one year. Does not accept minute values. After the time expires, the snapshot is removed during the next snapshot scheduled execution finds that the snapshot lifetime is expired. Snapshots replicated to other systems are not affected.
Naming SchemaSnapshot name format string. The default is auto-%Y-%m-%d_%H-%M. Must include the strings %Y, %m, %d, %H, and %M, which are replaced with the four-digit year, month, day of month, hour, and minute as defined in strftime(3). For example, snapshots of pool1 with a Naming Schema of customsnap-%Y%m%d.%H%M have names like pool1@customsnap-20190315.0527.
ScheduleShows a list of schedule preset options. See Schedule Presets below for more info.
BeginSets the start time for a snapshot. shows when Schedule is set to Hourly. Enter the hour and minute when the system can begin taking snapshots.
EndSets the end time for a snapshot. Shows when Schedule is set to Hourly. Enter the hour and minute the system must stop creating snapshots. Snapshots already in progress continue until complete.
Allow Taking Empty SnapshotsSets the task to allow taking a snapshot and creating a dataset even when there are no changes to the dataset from the last snapshot. Recommended for long-term restore points, multiple snapshot tasks pointed at the same datasets, or compatibility with snapshot schedules or replications created in TrueNAS 11.2 and earlier. For example, you can set up a monthly snapshot schedule to take monthly snapshots and still have a daily snapshot task taking snapshots of any changes to the dataset.
EnabledActivates this periodic snapshot schedule. To disable this task without deleting it, leave the checkbox cleared.

Schedule Presets

The Schedule dropdown list preset options are:

  • Hourly at the start of each hour
  • Daily At 00:00 (12:00 AM)
  • Weekly On Sundays at 00:00 (12:00 AM)
  • Monthly On the first day of the month at 00:00 (12:00 AM)
  • Create Custom schedule that opens the Advanced Scheduler window.

Advanced Scheduler

Tasks Advanced Scheduler

Choosing a Presets option populates the rest of the fields. To customize a schedule, enter crontab values for the Minutes/Hours/Days.

These fields accept standard cron values. The simplest option is to enter a single number in the field. The task runs when the time value matches that number. For example, entering 10 means that the job runs when the time is ten minutes past the hour.

An asterisk (*) means match all values.

Specific time ranges are set by entering hyphenated number values. For example, entering 30-35 in the Minutes field sets the task to run at minutes 30, 31, 32, 33, 34, and 35.

You can also enter lists of values. Enter individual values separated by a comma (,). For example, entering 1,14 in the Hours field means the task runs at 1:00 AM (0100) and 2:00 PM (1400).

A slash (/) designates a step value. For example, while entering * in Days means the task runs every day of the month, */2 means the task runs every other day.

Combining all the above examples together creates a schedule running a task each minute from 1:30-1:35 AM and 2:30-2:35 PM every other day.

There is an option to select which Months the task runs. Leaving each month unset is the same as selecting every month.

The Days of Week schedules the task to run on specific days. This is in addition to any listed days. For example, entering 1 in Days and setting Wed for Days of Week creates a schedule that starts a task on the first day of the month and every Wednesday of the month.

The Schedule Preview displays when the current settings mean the task runs.

Examples of CRON syntax

SyntaxMeaningExamples
*Every item.* (minutes) = every minute of the hour.
* (days) = every day.
*/NEvery Nth item.*/15 (minutes) = every 15th minute of the hour (every quarter hour).
*/3 (days) = every 3rd day.
*/3 (months) = every 3rd month.
Comma and hyphen/dashEach stated item (comma)
Each item in a range (hyphen/dash).
1,31 (minutes) = on the 1st and 31st minute of the hour.
1-3,31 (minutes) = on the 1st to 3rd minutes inclusive, and the 31st minute, of the hour.
mon-fri (days) = every Monday to Friday inclusive (every weekday).
mar,jun,sep,dec (months) = every March, June, September, December.

Days can be specified as days of month, or days of week.

With these options, you can create flexible schedules similar to these examples:

Desired scheduleValues to enter
3 times a day (at midnight, 08:00 and 16:00)months=*; days=*; hours=0/8 or 0,8,16; minutes=0
(Meaning: every day of every month, when hours=0/8/16 and minutes=0)
Every Monday, Wednesday and Friday, at 8.30 pmmonths=*; days=mon,wed,fri; hours=20; minutes=30
1st and 15th day of the month, during October to June, at 00:01 ammonths=oct-dec,jan-jun; days=1,15; hours=0; minutes=1
Every 15 minutes during the working week, which is 8am - 7pm (08:00 - 19:00) Monday to FridayNote that this requires two tasks to achieve:
(1) months=*; days=mon-fri; hours=8-18; minutes=*/15
(2) months=*; days=mon-fri; hours=19; minutes=0
We need the second scheduled item, to execute at 19:00, otherwise we would stop at 18:45. Another workaround would be to stop at 18:45 or 19:45 rather than 19:00.