Uploaded image for project: 'OpenShift API for Data Protection'
  1. OpenShift API for Data Protection
  2. OADP-822

Schedule Backup: failed to config backup every 10 minutes (*/10 format)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Minor Minor
    • OADP 1.2.0
    • OADP 1.1.0
    • OADP
    • False
    • Hide

      None

      Show
      None
    • False
    • ToDo
    • 0
    • 0
    • Very Likely
    • 0
    • None
    • Unset
    • Unknown
    • No

      Description of problem:

      while trying to run schedule backup every 10 minutes using crontab format "*/10 * * * *" - add schedule failed 

      valid crontab format - */10 * * * *

      Tried 2 formats:
      1) spec:
        schedule: */10 * * * * - "error: error parsing backup-scheduler-60pods.yaml: error converting YAML to JSON: yaml: line 9: did not find expected alphabetic or numeric character"
      2) spec:
        schedule: */10 * * * * -
      status:
        phase: FailedValidation
        validationErrors:
        - 'invalid schedule: Failed to parse int from *: strconv.Atoi: parsing "
      *": invalid
          syntax'

      Version-Release number of selected component (if applicable):

      OCP 4.10.26

      OADP 1.1.0-74

      How reproducible:

      Steps to Reproduce:
      1. Create schedule backup yaml
      2. oc apply -f {schedule.yaml} 
      3. oc get schedule -A

      Actual results:

      add schedule failed

      Expected results:

      succeed to add schedule

      Additional info:

      Example schedule.yaml :

      apiVersion: velero.io/v1
      kind: Schedule
      metadata:
        name: backup-scheduler-60pods-every-10min
        namespace: openshift-adp
        labels:
          velero.io/storage-location: example-velero-1
      spec:
        schedule: */10 * * * *
      OR
        schedule: */10 * * * *
        template:

      Create a test to verify the right format: (print date every 5 minutes)
      1) 

      [root@f01-h14-000-r640 ~]# cat test.sh 
      #!/bin/bash

      date >> test-time.log

      2) [root@f01-h14-000-r640 oadp-helpers]# crontab -l
      */5 * * * * /root/test.sh

      3) [root@f01-h14-000-r640 ~]# head test-time.log
      Thu Sep 29 15:50:01 UTC 2022
      Thu Sep 29 15:55:01 UTC 2022
      Thu Sep 29 16:00:01 UTC 2022
      Thu Sep 29 16:05:01 UTC 2022
      Thu Sep 29 16:10:01 UTC 2022
      Thu Sep 29 16:15:01 UTC 2022
      Thu Sep 29 16:20:01 UTC 2022
      Thu Sep 29 16:25:01 UTC 2022
      Thu Sep 29 16:30:01 UTC 2022
      Thu Sep 29 16:35:01 UTC 2022

       

       

       

       

       

       

       

       

       

        1. OADP_Crontab
          0.9 kB
          David Vaanunu

              marnold@redhat.com Matthew Arnold
              dvaanunu@redhat.com David Vaanunu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: