Skip to content

Schedules

chodeus edited this page Dec 3, 2026 · 23 revisions

ZFS Master NG can take snapshots of your datasets and make copies of them on a schedule. Times are in this server's time zone.

To schedule Go to
Every dataset Settings: Snapshot Every Dataset, Replicate Every Dataset
One dataset and the datasets below it Main tab: Actions, Schedules
One copy to one place Main tab: Actions, Replicate, then Repeat

Settings lists every schedule under Schedules.

Snapshots

  1. On the Main tab, open the dataset's Actions menu and choose Schedules.
  2. Under Snapshots, choose Every hour, On days of the week, Custom (cron) or When the array starts. For days, tick the days and set Starts at. For Custom, type a Cron line (see Custom times).
  3. Optional: fill in Snapshots to keep (see Snapshots to keep). Empty keeps all.
  4. Press Save. The answer says what the dataset takes now.

The datasets below this one follow the same schedule, unless they have their own.

Replication

Copies go into a dataset on this server that you choose, called Copy Under. For copies on another server, see Copies on another server.

  1. Make the dataset for the copies in another pool, such as backup: on the Main tab, use Create Dataset on that pool.
  2. On the dataset you want copied, open Actions and choose Schedules.
  3. Under Replication, choose Every hour, On days of the week, Custom (cron) or When the array starts.
  4. In Copy Under, type the name of the dataset from step 1, such as backup.
  5. Optional: fill in Snapshots to keep and Copy Keeps.
  6. Press Save.

What you get:

  • Each copy has its dataset's full name under Copy Under: tank/data goes to backup/tank/data.
  • Copies are read-only and not mounted, so nothing changes them between runs.
  • The first run sends the whole dataset. Later runs send only the changes.
  • Copy Under must already exist. If it doesn't, Save says so.
  • A run leaves out every dataset in the pool that holds Copy Under. That's why step 1 uses another pool.

Copies on another server

The other server must run ZFS Master NG too.

  1. Follow Copies between servers. It takes you through Accept Replicas Into on the other server, Add A Server here, and Test.
  2. Choose what to copy:
    • Every dataset: under Replicate Every Dataset, choose the server under Server, fill in Copy Under, choose how often, and press Save.
    • A dataset and those below it: on the dataset, open Actions, Schedules. Under Replication, choose how often, choose the server under Server, fill in Copy Under, and press Save.
    • One dataset only: use Replicate with Repeat (see Replicate repeats).
  • On the other server, copies go inside the dataset it keeps for this server's copies.
  • If Copy Under isn't there yet, the first run makes it, as an empty dataset that is read-only and not mounted.
  • The other server's Keep Replicas setting decides which snapshots its copies keep. Empty keeps all.

Default and None

Snapshots and Replication each start on Default.

  • Default: the dataset follows the nearest dataset above it that has its own schedule. If none has one, it follows Snapshot Every Dataset or Replicate Every Dataset in Settings. The dialog shows what Default follows now, and says when that one leaves the dataset out by Leave Out.
  • None: no scheduled snapshots, or no scheduled copies, for this dataset. The datasets below it follow None too, unless they have their own. A repeat set in Replicate still runs.
  • To go back to Default, choose Default and press Save. You can also press Remove beside the schedule in Settings.

Custom times

Custom (cron) runs a schedule at the times of a cron line, like the Custom schedule in the User Scripts plugin. Times are in this server's time zone. A cron line has five fields, split by spaces:

Field Values
minute 0 to 59
hour 0 to 23
day of the month 1 to 31
month 1 to 12, or jan to dec
day of the week 0 to 7 (0 and 7 are Sunday), or sun to sat

In a field, * means every value, 1-5 is a range, 1,15 is a list, and */15 or 0-30/10 takes every 15th or every 10th value.

Cron line Runs
*/15 * * * * every 15 minutes
0 */6 * * * every 6 hours, at 00:00, 06:00, 12:00 and 18:00
30 2 * * 1-5 at 02:30, Monday to Friday
0 3 1 * * at 03:00 on the 1st of each month
0 4 1 1,7 * at 04:00 on 1 January and 1 July
  • Set the day of the month or the day of the week, and leave the other *. Unraid's cron runs a line that sets both at other times, or never, so Save refuses it.
  • Save also refuses @hourly, @daily and the like: on Unraid they don't run at a set time. Give the five fields.
  • A step in the day of the month counts from 0, as Unraid's cron does: */2 runs on the 2nd, 4th … 30th, and */7 on the 7th, 14th, 21st and 28th.
  • Save's answer says when the next run is.

When the array starts

When the array starts runs a schedule each time the array starts, once its pools are mounted, like At Startup of Array in the User Scripts plugin, but not when it starts in Maintenance mode. If the array starts on its own at boot, that counts too.

  • Stopping and starting the array runs it again. (User Scripts' At First Array Start Only runs once per boot; here every start counts.)
  • Nothing runs when the array stops. A run then would hold up the stop: a copy still sending keeps its pool busy, and at shutdown Unraid stops waiting after its Shutdown time-out (Settings, Disk Settings), so the next boot runs a parity check.
  • Two schedules of one dataset can't both run when the array starts: saving the second says so.
  • It can start in the same minute as another schedule of its dataset, so Snapshots Pattern in Settings must have seconds while both are set: saving either one says so.

Array checks

Schedules follow the array as the Main tab shows it.

  • While the array is stopped, starting, stopping or in Maintenance mode, no scheduled run starts: Unraid takes the pools away then. Each run left is logged in /var/log/zfs.master.log, notified only at Every run, and is not a problem. Run Now says why it can't start.
  • When the array is told to stop, ZFS Master NG ends its runs so the pools can be released. A copy carries on from where it stopped at its next run.
  • A When the array starts run still goes while the array says Starting.
  • While a Parity-Check, Read-Check, Parity-Sync, Data-Rebuild or Disk-Clear runs, a scheduled copy that reads an array disk, or writes one on this server, takes its snapshot and sends nothing; the log says so. The next run after the check sends its own snapshot, with every change since the last copy. Keep removes the extra snapshots once the first run after the check lands. A paused check holds nothing.
  • An array disk here is one formatted ZFS: Unraid names its pool after the disk, such as disk1.
  • Snapshot schedules go on during a check, and a copy already sending when a check starts carries on. Replicate by hand is never held.
  • A copy to another server is held by a check on this server only. While that server's array is stopped, it refuses the copy, and the run counts a problem.

Snapshots to keep

After each run, only the snapshots this rule keeps stay. Type a number, periods, or both:

You type It keeps
24 the newest 24
7d the newest of each of the last 7 days that has one
4w the newest of each of the last 4 weeks that has one (weeks start on Monday)
12m the newest of each of the last 12 months that has one
24 7d 4w 12m every snapshot that any of these keeps
(empty) every snapshot

You can also use h for hours and y for years.

  • For Snapshots, the rule counts only the snapshots that snapshot schedules took.
  • For Replication, it counts the snapshots taken for copies under the same Copy Under, whichever schedule took them.
  • Snapshots you make by hand are never removed, except from a copy by Copy Keeps.
  • A snapshot that is held or cloned always stays.
  • A run removes up to 50 snapshots. The next runs remove the rest.
  • Example: a repeat on Mon, Wed and Fri with 6 keeps two weeks.

Copy Keeps

For a copy on this server: which snapshots the copy keeps.

You type The copy keeps
(empty) the same as its dataset: what Snapshots to keep removes there, it removes from the copy too
all every snapshot
rules, such as 30d 12m what these rules keep (see Snapshots to keep)
  • Rules count every snapshot in the copy, including ones sent by hand. The newest snapshot, and the one just sent, always stay.
  • With rules, a copy can keep more snapshots than its dataset, or fewer.
  • If you empty Copy Keeps later, the snapshots in the copy whose dataset no longer has them stay.
  • Copies on another server have no Copy Keeps: that server's Keep Replicas decides.

Datasets left out

A schedule or Replicate repeat never takes or copies these datasets:

Schedules and Replicate show a warning for one of these, and won't save a new schedule or repeat on it. Once in Replicate still copies it. A dataset below it can still have its own.

Replicate Every Dataset also leaves out:

  • the datasets in the pool it copies into on this server
  • a dataset whose own Replicate repeat already makes that same copy
  • a dataset whose name is too long for the bookmark its copy keeps (over about 70 characters under backup)

Snapshot Every Dataset and Replicate Every Dataset leave out each pool's own dataset, such as cache. Files kept in a pool outside its datasets get no scheduled snapshots or copies: Convert to Dataset makes such a folder a dataset.

Leave Out

Snapshot Every Dataset and Replicate Every Dataset each have a Leave Out field in Settings. Type the names of the datasets to leave out, split by commas, such as appdata, backup_*.

  • Each name matches a dataset at the top of a pool, such as cache/appdata, in every pool. A dataset deeper down with that name, such as cache/media/appdata, is not matched. A pool's own dataset is left out anyway.
  • A * at the end matches every name that starts with the text before it: backup_* matches backup_daily and backup_old.
  • The datasets below a matched one are left out too, unless one has a schedule of its own (Actions, Schedules in the Main tab).
  • The snapshots taken before stay. The copies made before stay too, and are no longer updated.
  • A rename in the Main tab can move a dataset into or out of Leave Out, such as renaming cache/appdata to cache/apps. The rename then says that Leave Out leaves it out, or no longer does. A copy it has is renamed with it.
  • When it can read every dataset, Save says how many datasets it leaves out, and names any entry that matches no dataset. When a run takes snapshots or makes copies, its line in the log says how many it left out.

Replicate repeats

A repeat copies one dataset to one place on a schedule. Each run takes a new snapshot and sends the changes since the last one.

  1. On the Main tab, open the dataset's Actions menu and choose Replicate.
  2. Under Server, choose This server or a server you added in Settings.
  3. Under Copy goes to, type where the copy goes:
    • on this server: a dataset name, such as backup/data
    • on another server: a name only, such as data. It goes inside the dataset that server keeps for this server's copies.
  4. Under Repeat, choose Every hour, On days of the week (set the days and Starts at) or Custom (cron) (type a Cron line), or When the array starts.
  5. Optional: fill in Snapshots to keep, and Copy Keeps for a copy on this server. Tick If the copy is gone, make it again to have a run send the whole dataset again when it finds the copy gone.
  6. Press Replicate. It runs now, then on its schedule.
  • Every hour runs at a minute of its own. The answer, and Settings, show which.
  • Snapshots to keep starts with the second run: the first run removes nothing.
  • To change what a repeat keeps, press Change Keep in its row in Settings.
  • If a run finds its copy gone, it sends the whole dataset again only when If the copy is gone, make it again was ticked. On this server, it also makes any missing dataset between the pool and the copy, empty, read-only and not mounted, to hold the copy. Without the tick, replicate once by hand to make a new copy. A run knows the copy was there from the bookmarks earlier runs left on the dataset. If those were removed too, it sends the whole dataset, as a first run does.
  • To tick or untick If the copy is gone, make it again or Replace a copy that no longer matches later, remove the repeat in Settings and add it again.
  • If the copy no longer matches the dataset (its newest snapshot isn't on the dataset, or it holds a newer one than the run sends), the run stops and says so. Tick Replace a copy that no longer matches, for a copy on this server, to have the run rename the old copy instead to its name followed by _replaced_ and the date and time, and then send the whole dataset. This works with Once too. Only a read-only copy is replaced, and only when it is not mounted, has no dataset below it (such as another dataset's copy), and does not have the name a schedule gives another dataset's copy. The old copy is never removed: the notification names it, so you can destroy it when you no longer need it. If the send fails and leaves nothing at the copy's name, the old copy gets its name back.
  • A repeat on a dataset that is now left out doesn't run. Its notification says why. Remove the repeat in Settings.
  • With Once, it copies one snapshot now. A bookmark keeps the next copy small, even after that snapshot is deleted.

Run Now

Run Now, in a schedule's row in Settings, runs that schedule once, now.

  • It takes the same snapshots and makes the same copies as a run at its times, and its Keep removes what it no longer keeps.
  • A notification says when it is done. A problem counts as a scheduled run's does, and a run that works clears the count.
  • It doesn't start while a run of the same schedule is still going.
  • It doesn't start in the seconds around a run at its times, of this schedule or of one sharing a dataset with it: try again 10 seconds later.
  • It needs seconds in Snapshots Pattern. Without them, a run now could take the snapshot name a scheduled run needs.

Snapshot notes

A snapshot schedule can have a Note: in Settings for Snapshot Every Dataset, or in the Snapshots part of a dataset's Schedules. Each snapshot it takes gets the note, shown in Snapshots Admin's Note column.

  • A dataset with its own schedule gets that schedule's note.
  • A changed note goes on snapshots taken after the change; change older ones in Snapshots Admin.
  • Replicate's snapshots get no note.

Renames and destroys

  • Renaming a dataset moves its schedules and Replicate repeats with it.
  • Its copies under Copy Under on this server are renamed with it where it is safe. The rename says which copies stayed.
  • A copy on another server keeps its old name. The next run sends the dataset there again, in full, under the new name.
  • Nothing is renamed while a copy of the dataset, or of a dataset below it, runs.
  • Destroying a dataset removes its schedules and repeats. Its copies stay.

Encrypted datasets

For an encrypted dataset, Replicate shows Send. It decides how a new copy is made:

  • Raw (the default): the copy stays encrypted with this dataset's key. Its data stays secret where it lands, and it is sent even when the key isn't loaded here. To read the copy there, load this key there.

  • Decrypted: the copy is plain, or it takes the key of the encrypted dataset it goes into. The key must be loaded here, and also there when the copy goes inside an encrypted dataset.

  • A copy that is already there is updated the way it was made, whatever Send says, because ZFS takes nothing else into it. To change it, replicate to a new name.

  • ZFS Master NG marks each copy it receives decrypted with the property zfs.master:raw=off. A copy that another tool sent decrypted into an encrypted dataset has no mark, so it is sent raw, and ZFS refuses that. To update it, run zfs set zfs.master:raw=off <copy> there once.

  • A run that stopped part-way carries on the way it went.

  • A repeat keeps the choice for a run that has to make the copy again.

  • Schedules and Replicate Every Dataset make each new copy raw.

  • A server that runs an older ZFS Master NG can't mark a copy, so Decrypted makes no new copy there: update the plugin there, or pick Raw. A copy already there goes as Send says: keep Raw for a copy this plugin made.

Notifications and the log

  • Schedule Notifications in Settings, Alerts, picks which runs notify: Problems (the default: as below, and a copy of one dataset that makes datasets or replaces its copy), Every run (each run's result, as Run Now), or Off (the log only). Run Now notifies each run whatever it says.
  • The first run with a problem sends a notification.
  • After that, problems of runs at its times go to the log only, /var/log/zfs.master.log, until a run works again. Run Now notifies of each run.
  • The run that works again sends a notification that says so.
  • A run waits up to 55 minutes for another copy of the same dataset, made by hand or by another schedule, to finish. If it still can't start, it is skipped, and that counts as a problem.
  • If a schedule's run before is still going when its next run is due, that run is skipped and logged. Once the run before has gone on for an hour (snapshots) or a day (copies), a skip counts as a problem.