Snapshots.schedule CRON expressions - duplicate snapshots

To what extent are CRON expressions supported when setting the snapshots.schedule option?

Should the following example, snapshot every six hours, be expected to complete normally?

lxc config set mycontainer snapshots.schedule “0 */6 * * *”

Thanks in advance,

If you don’t get a parsing error when you set it, then it should work fine.

We’re using a Go package that does the parsing and figures out when the next trigger is meant to happen.


I’ve been able to pass the above expression as well as define multiple values “0 2,8,14,20 * * *” without getting an error. The former provides two snapshots, one at the 59 mark and one at the 00 mark. The latter hasn’t provided any snapshots. I’ll post some examples here shortly.

I think I may have a different problem. My use cases all contained examples as previously listed. However, in testing, I appear to receive duplicate snapshots no matter what expression is entered.

lxc config show test

architecture: x86_64
  image.architecture: amd64
  image.description: ubuntu 18.04 LTS amd64 (release) (20190212.1)
  image.label: release
  image.os: ubuntu
  image.release: bionic
  image.serial: "20190212.1"
  image.version: "18.04"
  snapshots.schedule: 24 * * * *
  volatile.base_image: 35f6bff57c250208c6dc73445eefe8c1020853a1bc8571ebd8bfb1fe3a239504
  volatile.eth0.hwaddr: 00:16:3e:1c:54:ff
  volatile.idmap.base: "0" '[{"Isuid":true,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
  volatile.last_state.idmap: '[{"Isuid":true,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
  volatile.last_state.power: RUNNING
devices: {}
ephemeral: false
- default
stateful: false
description: ""

lxc info test

Name: test
Location: none
Remote: unix://
Architecture: x86_64
Created: 2019/02/17 03:47 UTC
Status: Running
Type: persistent
Profiles: default
Pid: 15612
  eth0: inet
  eth0: inet6   fe80::216:3eff:fe1c:54ff
  lo:   inet
  lo:   inet6   ::1
  Processes: 24
  Disk usage:
    root: 23.09MB
  CPU usage:
    CPU usage (in seconds): 5
  Memory usage:
    Memory (current): 128.97MB
    Memory (peak): 186.40MB
  Network usage:
      Bytes received: 1.47MB
      Bytes sent: 11.39kB
      Packets received: 14264
      Packets sent: 128
      Bytes received: 1.41kB
      Bytes sent: 1.41kB
      Packets received: 16
      Packets sent: 16
  snap52 (taken at 2019/02/17 05:16 UTC) (stateless)
  snap53 (taken at 2019/02/17 05:23 UTC) (stateless)
  snap54 (taken at 2019/02/17 05:24 UTC) (stateless)

Perhaps this isn’t the forum for my problem, should I open an issue surrounding this? Would there be any relevant log files? Unfortunately, I’ve exhausted my ability to self-diagnose.

Thanks again,

What do you mean by duplicate snapshots?
What snapshots did that expression gave you?

Using my last post as the example, my expression of “24 * * * *” gave a snapshot at both 05:23 and 05:24 for some reason (snap53 and snap54). It continues to do this every hour it runs.

I’m using the LXD Snap on Debian Stretch.

Ok, @monstermunchkin should be able to help with that

Thanks for noticing. This is a bug, and is being tracked in