Bacula - Understand a schedule - schedule

I'm studying bacula and I need to understand this schedule:
Schedule {
Name = Daily
Run = Full 1st sun at 00:05
Run = Differential 2nd-5th sun at 00:05
Run = Incremental mon-sat at 00:05
}
And this is what I understand:
There's a full backup every first Sunday of the month at 00:05
There's a differential backup every Sunday of second, third, fourth, and fifth week of the month at 00:05
There'a an incremental backup every day from Monday to Friday at 00:05
Is that correct?
In 2. the differential backup refers to the previous full/differential backup? So to the previous Sunday?

1 and 2 are correct.
in 3.There is an incremental backup every day from Monday to Saturday at 00:05
Now differential backups refer to the previous full backup. So it will refer to one to 3 Sundays ago.
This way in order to restore a file, Bacula needs to go back and look for
one full backup
one differential backup
some incremental backups

Related

Reoccurring SQL job to run on the 2nd and 4th Thursday of every month

I need a job to run on the 2nd and 4th Thursday of every month. I know I can set up a job to run every two weeks but that logic doesn't work when a month eventually hits a five week span. Is it possible to set this up using the SQL Server Agent Schedule? If not, does anyone recommend another method?
Create two schedules on the job, one that runs on the second Thursday, and one that runs on the fourth.
Under the Frequency heading on the Scheduler, change the Occurs drop down to Monthly to get to the options you need.

BigQuery UI - How to schedule a query to run on the last day of the month?

I have a query that pulls a summary of metrics for the past month that needs to run on the last day of each month at a set time.
The BigQuery 'Schedule query' UI allows you to choose a date and time to run a query each month but there is no apparent option to choose that last day of the month.
If I simply choose the 31st of the month, what happens if there are only 30-days in that month? Will the query still run?
Or do I have to schedule a query to run on the 27th, 28th, 29th, 30th, 31st of the month to make sure that I don't miss the correct date?
I can't find any mention of this situation in the BigQuery documentation or online so any help/suggestions will be very gratefully received.
I understand that you need to run your query in the last day of each month. However, if you set 31st of the month as the schedule options, it will skip the months which do not have 31 days.
You can check this affirmation, by performing the following test in the BigQuery UI:
In the Schedule query options, under Schedule options, set:
Repeats: Monthly
On the: 31
Start date and run time: set the date to 10th of June (which is a month with 30 days)
Click Schedule
On the left side of the BigQuery UI, click on Scheduled queries
Check the query you saved. Among other details, it should be displayed Next Scheduled.
It will be shown July, 31
As you can see, it skipped the 30th of June. Thus, when you configure your query to run on the 31st of each month, it will ignore the months with less than 31 days. For this reason, I would advise you to select 27th, 28th, 29th, 30th, 31st of each month in order to run it in a manner that suits you.
As a bonus information, you can set up a Custom schedule option, as mentioned here. You can use syntaxes as "1st monday of month 00:00" or "every monday 00:00", here.

Get this week equivalent from last year

Working with SQL 2005 and I am trying to get this current weeks data equivalent from last year.
The week runs from Sunday to Friday. However as today is only Thursday I need the data from Sunday to Thursday from last year on this current date.
When I run the script again tomorrow it would need to be the data from a year ago for Sunday to - Friday.
Not really sure how to do this. Or even where to start, tried lots of things and lots of googling and not got anywhere, any suggestions?

Scheduling a SQL Job

what is the best way to schedule a SQL Job to run from (any date range) i.e. 15th to 18th every single month with no end date?
Thanks in advance.
john
SQL Server 2008 you can set the frequency to occur Monthly and have 3 or 4 individual schedules to occur on the 15th, 16th, 17th, and 18th day of each month. Similar to the below image.
Not the cleanest solution but it does work.

T-SQL Task generator script

I need to create a T-SQL (I`m using SQL Server 2008 Express) script (procedure/function) that takes entries from a "Tasks" table and generates only the tasks planned to occur in the next 5 hours.
In the "Tasks" table I should have tasks with job like properties :
Occurrence : One time or Recursive
Frequency : every x Days, Weeks, Months
Depending on the Frequency :
For Daily : every x hours,minutes
For Weekly -Days of the week when the task should occur
For Monthly - The first,second,last -day,week day,weekend -
day of week OR The 1st, 2nd, 3rd..31st of the month.
When I run the script I should get only the tasks that will occur in the next 5 hours or less in the case if task occurs every x minutes.
So what this script should actually do is use all the options from a SQL Server Job for a task.
Example1: I create a task "Check email" that occurs every day, between 14:00 and 15:00 . When i run the script at 09:00 I would get Task:"Check email" Time:5 hours left until task, because it occurs every day, i should be able to get this result every day when I roll the script ,only if that 5 hours or less range .
Example2: A task "Send hours report" that occurs Monthly, on the 1st week day (not weekend), at 01:00 PM . Running the script on the first week day of the month at 08:00 AM I should get Task:"Send hours report" Time:5 hours until task
I know it's a quite big request but hopefully someone will find it easy what for me seems pretty hard.
You should also store somewhere the date/time of the last execution of each job (at least for jobs that are configured for every x hours/minutes). The idea is to calculate the next execution date/time for each job, and return it if it's less than 5 hours away. If the job is configured for every x hours/minutes, use DATEADD and check if the result is within the configured timeframe. If the job is configured for daily (at a specified time), just check if the specified time is less than 5 hours away (but still in the future). I have done a similar feature and it's not an easy thing to check for all cases (it took me a few days of coding).