Delphix Products

  • 1.  How to refresh a VDB on the first Sunday of each month?

    Posted 07-31-2018 06:43:00 AM
    I need some help because that cron expression doesn't help to refresh a VDB on the 1st Sunday of each month.

    #Virtualization


  • 2.  RE: How to refresh a VDB on the first Sunday of each month?

    Posted 07-31-2018 07:08:00 AM
    Hi Tako,

    I haven't tested this with Delphix but a standard way to run a job on the first Sunday of every month using cron is to put a test in the expression like:

    0 9 1-7 * * [ $(date +\%u) = 7 ] && YourScript

    Here we are saying, if the day number of the current date is 7 (a Sunday) run the YourScript and we will only run the script in the first 7 days of the month (1-7).

    So we need to know what Delphix will allow us to put in the custom cron expression so I suggest you test it.  Start with this:

    0 9 1-7 * * [ $(date +\%u) = 7 ] &&

    Hopefully Delphix just appends it's refresh script to the end of the cron expression so it will work.  I'll test it myself when I get a chance but let me know how it goes.


  • 3.  RE: How to refresh a VDB on the first Sunday of each month?

    Posted 07-31-2018 07:23:00 AM

    Hi Matt,

    Thanks for your quick reply.  It will definitely run on crontab but Delphix is very intelligent to find out it's not a proper cron expression =( :

    30 5 1-7 * * [ $(date +\%u) = 7 ] &&
    Incorrectly formatted cron expression.

    and in CLI:
    update scheduleList 0 *> commit
       Error: The policy could not be applied because the schedule "30 5 1-7 * * [ $(date +\%u) = 7 ] &&" is invalid.
      Action: Check the schedule string and try again.



  • 4.  RE: How to refresh a VDB on the first Sunday of each month?
    Best Answer

    Posted 07-31-2018 07:41:00 AM
    Tako,

    I've just checked and it is actually much simpler than my first example.  Delphix uses the Quartz CronTrigger Scheduler so this should work nicely...

    0 0 9 ? * 7#1



  • 5.  RE: How to refresh a VDB on the first Sunday of each month?
    Best Answer

    Posted 07-31-2018 08:43:00 AM
    Hi Matt,

    Thanks again.  I've checked how Quartz cron works and put a refresh policy 0 0 5 ? * 7#1.  Will let you know next Monday whether it works or not  =)

    imo Delphix GUI needs improvement.  Most of the tasks involves CLI...

    ps. I'm newbie to Delphix

    Regards,
    Tako


  • 6.  RE: How to refresh a VDB on the first Sunday of each month?

    Posted 07-31-2018 07:25:00 PM
    Hi Tako,
    Can you explain why you'd like to only refresh your VDBs monthly? The scheduler allows for a shorter time span than that, at weekly or daily or hourly. I'm just looking to understand the longer time frame so that I can request the feature for you and put it in front of our product team. 

    @Matt, thank you so much for stepping in here. Cron is not the friendliest format.

    Quick question to you both, don't we want 1#1 in the last field to reflect the 1st Sunday of each month? (http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html">http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html">http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html )

    Thanks,
    Michael


  • 7.  RE: How to refresh a VDB on the first Sunday of each month?
    Best Answer

    Posted 08-01-2018 06:21:00 AM
    Well spotted Michael.  1-7 = Sun-Sat in this format.  

    Tako, you need a 1 not a 7.