Adding a Schedule to a Snapshot Policy

Add schedules to a snapshot policy.

A snapshot policy can contain a maximum of 10 schedules, and schedules must be a combination of schedule type, effective from, and snapshot retention duration that's unique to the policy. You can add schedules to a snapshot policy at the same time you create the snapshot policy. You can add more schedules to an existing policy, if needed.

When you create a snapshot schedule, you can configure the time that the schedule becomes effective, how often the schedule runs, provide other timing details, and set the retention duration for snapshots created by the schedule. For more information, see Schedule Types and Timing.

    1. Open the navigation menu and click Storage. Under File Storage, click File Systems.
    2. (Optional) In the List scope section, under Compartment, select a compartment.
    3. Under Additional resources, click Snapshot Policies.
    4. Click the name of the snapshot policy that you want to add a schedule to.
    5. On the snapshot policy's details page, under Resources, click Schedules.
    6. Click Add schedule.
    7. In the Add schedule panel, provide the following details:
      1. (Optional) Schedule Prefix: Enter a prefix for all snapshots created by the schedule. Avoid entering confidential information.
      2. Schedule type: Select the frequency at which the snapshots are taken:
        • Hourly: A snapshot is created hourly; but not necessarily at the top of each hour.
          Note

          A snapshot policy can contain only one schedule set to create snapshots hourly.
        • Daily: A snapshot is created every 24 hours.
        • Weekly: A snapshot is created on selected day of the week.
        • Monthly: A snapshot is created on a selected day of the month.
        • Yearly: A snapshot is created on a selected month and day of the year.
      3. (Optional) Schedule effective from: Choose whether the schedule becomes effective immediately, or at a selected date and time. For more information, see Schedule Types and Timing.
      4. (Optional) Schedule details: Depending on the schedule type, select the Time format and add the details in the corresponding fields. If you don't choose a specific value, and leave the default value of Automatic, the system chooses an available value for you.
      5. (Optional) Snapshot Retention Duration: The duration that the snapshot is retained before it's deleted by the system. If you don't provide a value, the system sets a default value. For more information, see retention time.
    8. Click Add schedule.
  • Use the oci fs filesystem-snapshot-policy update command and the --schedules parameter to add schedules to a snapshot policy:

    oci fs filesystem-snapshot-policy update --filesystem-snapshot-policy-id <snapshot_policy_OCID> --schedules [<list_of_JSON_schedules>] [OPTIONS]

    The following example includes a schedules object with multiple schedules:

    oci fs filesystem-snapshot-policy update --filesystem-snapshot-policy-id <snapshot_policy_OCID> --schedules '[{"timeZone":"UTC", "period":"DAILY", "hourOfDay":18}, {"timeZone":"UTC", "period":"WEEKLY", "hourOfDay":12, "dayOfWeek":"TUESDAY"}]'
    

    For a complete list of flags and variable options for CLI commands, see the CLI Command Reference.

  • Use UpdateFilesystemSnapshotPolicy to add a schedule to an existing snapshot policy.

    For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.