ONTAP Discussions

volume snapshot policy create question

ANTON_MSSM
5,618 Views

Hi, I want to be able to create a policy for my cifs vserver that takes snapshots at specific times. on 7mode this is easy, I bet its easy on 8mode too if I knew how get the syntax correctly.

Ive been reading this https://library.netapp.com/ecmdocs/ECMP1197113/html/GUID-EE28F2E6-A114-4345-B7B5-858EF5D58563.html which shows an example so here is what I dont understand, where can I specify the hours that I want this snapshot to be on ?

I want the hourly snapshot to happen at 6,9,12,15,18

I also want to keep 1 nightly that happens at 0

I dont want any weekly snapshots

vserverA::> volume snapshot policy create -vserver vserverA -policy default-keep-5-hourly -schedule1 hourly -count1 5 -prefix1 hourly -enabled true

:volume snapshot policy> show

Vserver: vserverA

                         Number of Is

Policy Name              Schedules Enabled Comment

------------------------ --------- ------- ----------------------------------

default-keep-5-hourly            1 true    -

    Schedule               Count     Prefix                 SnapMirror Label

    ---------------------- -----     ---------------------- -------------------

    hourly                     5     hourly                 - 

Ok thats great, but when does it occur at hourly ? every hour?   Can somebody point out the correct syntax, thanks

4 REPLIES 4

JTVNETAPP
5,618 Views

take a look at "job schedule show"  this will show the hourly schedule.  and then "job schedule cron" to modify or create a new schedule to your liking, which you can then use with the snapshot policy.

Hope this helps.

ANTON_MSSM
5,618 Views

thats great thanks you for pointing me in the right direction, I was able to create a cron and link it the the policy. now another question... how do I add an additional cron to an existing policy schedule ?

:volume snapshot policy> show

Vserver: cifs_test

                         Number of Is

Policy Name              Schedules Enabled Comment

------------------------ --------- ------- ----------------------------------

default-keep-5-hourly            1 true    -

    Schedule               Count     Prefix                 SnapMirror Label

    ---------------------- -----     ---------------------- -------------------

    cifs_cron                104     hourly                 -

now I created another cron job that will do a daily backup at 0:30, called it cifs_cron_nightly

:volume snapshot policy> job schedule show -name cifs_cron_nightly

  Schedule Name: cifs_cron_nightly

Schedule Type: cron

  Description: @0:30

Or do I have to create a new policy ? because the default policy has 3 schedules;

Policy Name              Schedules Enabled Comment

------------------------ --------- ------- ----------------------------------

default                          3 true    Default policy with hourly, daily & weekly schedules.

    Schedule               Count     Prefix                 SnapMirror Label

    ---------------------- -----     ---------------------- -------------------

    hourly                     6     hourly                 -

    daily                      2     daily                  daily

    weekly                     2     weekly                 weekly

I want to do the same thing more or less

JTVNETAPP
5,618 Views

I would create a new policy which combines the up to 5 schedules you want.

vol snapshot policy create -policy test -enabled true ?

  (volume snapshot policy create)

  [ -comment <text> ]         Comment

   [-schedule1] <text>        Schedule1 Name

   [-count1] {0..255}         Maximum Snapshot Copies for Schedule1

  [ -prefix1 <text> ]         Snapshot Copy Name Prefix for Schedule1

  [ -schedule2 <text> ]       Schedule2 Name

  [ -count2 {0..255} ]        Maximum Snapshot Copies for Schedule2

  [ -prefix2 <text> ]         Snapshot Copy Name Prefix for Schedule2

  [ -schedule3 <text> ]       Schedule3 Name

  [ -count3 {0..255} ]        Maximum Snapshot Copies for Schedule3

  [ -prefix3 <text> ]         Snapshot Copy Name Prefix for Schedule3

  [ -schedule4 <text> ]       Schedule4 Name

  [ -count4 {0..255} ]        Maximum Snapshot Copies for Schedule4

  [ -prefix4 <text> ]         Snapshot Copy Name Prefix for Schedule4

  [ -schedule5 <text> ]       Schedule5 Name

  [ -count5 {0..255} ]        Maximum Snapshot Copies for Schedule5

  [ -prefix5 <text> ]         Snapshot Copy Name Prefix for Schedule5

ANTON_MSSM
5,618 Views

ok it looks like re-creating the policy is the way to go because I cannot modify the existing policy and schedules... strange. 

Public