Data Backup and Recovery

How to schedule 14 daily, 5 weekly and 1 monthly with the 'cron' frequency ?

kris_boeckx
9,095 Views

Hi,

I'm using SC 4.1 and snapdrive to backup a lot of RDM's.

I need to schedule 14 daily, 5 weekly en 6 monthly backups of those jobs.

At the definition of the schedule I choose 'cron' for the frequency so I can define a custom job schedule.

The backup job can only run once a day because it triggers other actions.

I want this:

* 14 daily backups on MON,TUE,WED,THU,FRI,SAT

* 5 weekly backup on SUN but not on the last sunday of the month

* 1 monthly backup on the last sunday of the month


How can this be achieved ?

Greets,

Kris

1 ACCEPTED SOLUTION

kris_boeckx
9,095 Views

Chris, Thanks for your reply.

The problem resides: Support for specifying both a day-of-week and a day-of-month value is not complete (you must currently use the '?' character in one of these fields). This means you can't use both in one cron line.

I think I'm going to solve it this way for now:

14 Daily backups with cron line: 0 15 3 ? * MON,TUE,WED,THU,FRI,SAT *

26 Weekly backups with the 'weekly' frequency sunday @ 3:15 AM

This way I have my monthly backup as weekly one's and keeping those weekly backups 26 week means 6 months.

Keith,

Can you maybe discuss this issue with development of SC and see if there is something possible in the future ?

Thanks all for clearing this one. There is no solution but there is a work around

Greetz,

Kris

View solution in original post

8 REPLIES 8

ktenzer
9,095 Views

Hi Kris,

Below is link to documentation for Quartz which is what we use as our trigger:

http://www.quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger

0 0/60 0-14 ? * MON-SAT - this should create a backup every hour starting at midnight to 2pm which would create 14 backups per day

0 0/60 0-5 ? * SUN - this should create 5 backups every hour from midnight to 5am on sunday

0 0 0 ? * 1L - this should create backup on last sunday of every month at midnight

Hope this helps

Keith

kris_boeckx
9,095 Views

Hi Keith,

I already read that page last week (and snapcreator admin guide) but did not get a working solution.

To be clear: by daily, I mean once per day, by weekly I mean once per week and by monthly I mean once per month (last or first day of the month)

The problem is that I can(may) run the backup job only once a day and combining this with the cron frequency does not give me a working solution

I tried this:

Every day except sunday -    Daily schedule:       0 15 3 2-31 9 1-6 *

Every sunday -                     Weekly schedule:   0 15 3 2-31 * 7 *

Every first day of the month - Monthly schedule:   0 15 3 1 * * *

But as stated in the notes of the hyper link: Support for specifying both a day-of-week and a day-of-month value is not complete (you must currently use the '?' character in one of these fields).

This means that the daily schedule and weekly schedule are not accepted by snapcreator because quartz does not accept them.

Is there an other solution or do I see this whole cron schedule thing the wrong way ?

Greets,

Kris

sivar
9,095 Views

Kris,

Please use http://www.cronmaker.com/

I generated a test syntax for your daily

0 51 3 ? * MON,TUE,WED,THU,FRI,SAT *

You may try that tool and let me know if you still need help achieving the schedule you want.

Thanks,
Siva Ramanathan

kris_boeckx
9,095 Views

I also found this website but this did not helped me either.

Thanks for the sugestion.

ktenzer
9,095 Views

Oh BTW can you give more details about the environment? Is this windows? What is your backup strategy? How is Snap Creator helping or how do you hope it can help?

Regards,

Keith

kris_boeckx
9,095 Views

Keith,

To give you more info:

We have a Windows environment and use Snapdrive, Snapmanager For SQL ,Snapmanager For Exchange and vibe (prehistoric SMVI) to create snapshots.

For the moment I'm migrating SC 3.6 to 4.1

SC help use centralize and simplify the scheduling and reporting of the backups we need to do. (for the moment no more than that ).

We use post (powershell) scripts to handle some tasks because SC does not provide them:

* Send notification to nagios

* Update a QTREE snapmirror and rotate snapshots on the destination. (We will migrate clustered Ontap and VOLUME snapmirror so SC can handle this in the future)

* trigger ndmp backup to tape

This setup works fine for us.

Greetz,

Kris

clilescapario
9,095 Views

It's not clear but since you say "The backup job can only run once a day because it triggers other actions" it sounds like you want to know "How do I schedule daily/weekly/monthly with cron?" and "How do I retain those for the said retention times?".

Break it down into 2 separate problems. Create schedules and then apply those schedules to a retention policy. You can then assign your policy to a set of configs in a profile.

You have highlighted another good point, "How do I trigger daily/weekly/monthly without duplicating backups?" Since I was unable to figure out the weekly/monthly problem I use:

0 0 0 ? * MON-SAT
0 0 0 ? * SUN
0 15 0 ? * SUN#1

In your case, perhaps you would add logic in the postscript to not execute if it was the last sunday in the month. If some quartz guru has a solution on how to do the weekly/monthly better it would help!

You can also see http://www.cronmaker.com/ to run some tests to see when a scheulde would start.

--

Chris


kris_boeckx
9,096 Views

Chris, Thanks for your reply.

The problem resides: Support for specifying both a day-of-week and a day-of-month value is not complete (you must currently use the '?' character in one of these fields). This means you can't use both in one cron line.

I think I'm going to solve it this way for now:

14 Daily backups with cron line: 0 15 3 ? * MON,TUE,WED,THU,FRI,SAT *

26 Weekly backups with the 'weekly' frequency sunday @ 3:15 AM

This way I have my monthly backup as weekly one's and keeping those weekly backups 26 week means 6 months.

Keith,

Can you maybe discuss this issue with development of SC and see if there is something possible in the future ?

Thanks all for clearing this one. There is no solution but there is a work around

Greetz,

Kris

Public