Go to main content
Oracle® ZFS Storage Appliance Administration Guide, Release OS8.7.0

Exit Print View

Updated: July 2017
 
 

Scheduling Snapshots (CLI)

Use the following procedure to configure automatic snapshots of a share and set a retention policy for those snapshots.

Automatic snapshots can be taken half-hourly, hourly, daily, weekly, or monthly and are named .auto[-<snaplabel>]-<timestamp>. Snapshot creation times are stored and executed in UTC format, without regard to such conventions as daylight saving time. For example, a snapshot scheduled for 10:00 a.m. PST (UTC-8) is stored and executed at 18:00 UTC, and this is the time that will appear as the timestamp in the snapshot name.

Automatic snapshots can be set on a project or a share, but not both. Otherwise, overlapping schedules and retention policies would make it impossible to guarantee both schedules. Removing an interval, or changing its retention policy, will immediately destroy any automatic snapshots not covered by the new schedule. Automatic snapshots with clones are ignored.


Note -  Previous versions of the software allowed for automatic snapshots at the frequency of a minute. To help users avoid placing undue stress on the system, this feature was removed with the 2010.Q3 release. If the software is rolled back, existing minutes will be preserved. Previous instances will expire according to the existing schedule, but no new snapshots will be taken. An alert will be posted if a share or project with this frequency is found.
  1. Go to shares and select the project or share you want to snapshot.
    hostname:> shares select myproject
    hostname:shares myproject> select demo_share
    hostname:shares myproject/demo_share>
  2. Enter snapshots automatic.
    hostname:shares myproject/demo_share> snapshots automatic
    hostname:shares myproject/demo_share snapshots automatic>
  3. Use the create command to enter an uncommitted schedule context.
    hostname:shares myproject/demo_share snapshots automatic> create
    hostname:shares myproject/demo_share snapshots automatic (uncommitted)>
  4. Use the set command to set each field appropriately.
    1. Set the frequency to halfhour, hour, day, week, or month to indicate how often the snapshot is automatically taken.
    2. Set the day, hour, and minute to specify the precise time the snapshot is automatically taken.

      For half-hourly or hourly snapshots, you can choose how many minutes after the half-hour or hour the snapshot is taken. For daily snapshots, you can choose the hour and minute the snapshot is taken, and for weekly or monthly snapshots, you can specify the day, hour, and minute.

    3. Set the keep property to the number of snapshots you want to retain for this schedule.

      Automatic snapshots can be kept forever (except for half-hourly and hourly snapshots, which are capped at 48 and 24, respectively), or they can be limited to a certain number. When the number of snapshots exceeds the number you have specified here, the oldest snapshots will be deleted first.

    hostname:shares myproject/demo_share snapshots automatic (uncommitted)> set frequency=day
                         frequency = day (uncommitted)
    hostname:shares myproject/demo_share snapshots automatic (uncommitted)> set hour=14
                              hour = 14 (uncommitted)
    hostname:shares myproject/demo_share snapshots automatic (uncommitted)> set minute=30
                            minute = 30 (uncommitted)
    hostname:shares myproject/demo_share snapshots automatic (uncommitted)> set keep=7
                              keep = 7 (uncommitted)

    You can use the get command to view the current uncommitted settings.

    hostname:shares myproject/demo_share snapshots automatic (uncommitted)> get
                         frequency = day (uncommitted)
                               day = (unset)
                              hour = 14 (uncommitted)
                            minute = 30 (uncommitted)
                              keep = 7 (uncommitted)
  5. Enter commit to commit the changes and create the automatic snapshot schedule.
    hostname:shares myproject/demo_share snapshots automatic (uncommitted)> commit

    You can use the list command to view your new schedule.

    hostname:shares myproject/demo_share snapshots automatic> list
    NAME                 FREQUENCY            DAY                  HH:MM KEEP
    automatic-000        day                  -                    14:30    7
  6. Enter done to finish.
    hostname:shares myproject/demo_share snapshots automatic> done
    hostname:shares myproject/demo_share snapshots>