How To Create A Snapshot Retention Policy in Clustered Data ONTAP Using The CLI

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

How to create a snapshot retention policy in clustered Data ONTAP

using the CLI

https://kb.netapp.com/onprem/ontap/os/How_to_create_a_snapshot_retention_policy_in_clustered_Dat…
Updated: Wed, 27 Sep 2023 18:33:01 GMT

Applies to
• Clustered Data ONTAP
• ONTAP 9
• Snapshot Policy

Description

This article describes the procedure that should be followed to create a retention policy for automatically
triggered snapshots in clustered Data ONTAP using the CLI.

'NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations
provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations
provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or 1
techniques herein is a customers responsibility and depends on the customers ability to evaluate and integrate them into the customers operational
environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this
document.'
Procedure

Perform the following steps to create a retention policy for automatically generated snapshots from the system
CLI:

1. Create a 'cron schedule' that will run at a certain time.

Example:
job schedule cron create -name dailySnap -hour 23 -minute 0 (creates a schedule
that will be run every day at 11 p.m)
job schedule cron create -name weeklySnap -dayofweek Sunday -minute
0 (creates a schedule that will be run every Sunday)

Note: The 'minute' flag MUST be used to create the schedule.

For more information on creating a cron schedule , see the job schedule cron create manual.

2. Create a snapshot policy that will be assigned to a volume.

Example:

volume snapshot policy create -policy 2days2weeks -enabled true -schedule1


dailySnap -count1 2 -prefix1 dailySnap -schedule2 weeklySnap -count2 2
-prefix2 weeklySnap (creates a policy that keeps two daily snapshots and two weekly snapshots)

For more information on creating a snapshot policy, see the volume snapshot policy create manual.

3. Associate the policy with a created volume.

Example:
volume modify -volume volName -vserver vserverName -snapshot-policy
2days2weeks

Volume volName now has a snapshot policy that will retain only two daily snapshots and two weekly
snapshots.

Note: Snapshot policies cannot be created for manually triggered snapshots.

Additional Information
• Creating schedules using System Manager

© 2023 NetApp.No part of this document covered by copyright may be reproduced in any form or by any means—graphic, electronic, or mechanical,
including photocopying, recording, taping, or storage in an electronic retrieval system—without prior written permission of the copyright owner. For more
information, see Legal Notices. 2
• Creating Snapshot policies using System Manager

© 2023 NetApp.No part of this document covered by copyright may be reproduced in any form or by any means—graphic, electronic, or mechanical,
including photocopying, recording, taping, or storage in an electronic retrieval system—without prior written permission of the copyright owner. For more
information, see Legal Notices. 3

You might also like