Cronjob- every hour on Mondays [closed] - cron

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
Is there anyway to make a cronjob run every hour just on Mondays , every week.
* * * * 1
stands for At every minute on Monday. But I am looking for similar thing for every hour on Mondays.
Thanks,

Cron expression would look like with explaination:
min hour day(month) month day(week)
0 0-23 * * 1
* any value
, value list separator
- range of values
/ step values
“At minute 0 past every hour from 0 through 23 on Monday.”

0 0-23 * * mon
You can use the above. This will schedule your job to run at minute 0 past every hour from 0 through 23 on Monday.
This means:
at 2018-05-07 00:00:00
at 2018-05-07 01:00:00
at 2018-05-07 02:00:00
at 2018-05-07 03:00:00
at 2018-05-07 04:00:00 and so on.
Hope this helps!

Related

Excel: Time * 24 returns negative number? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I have a field D19 in time format with value 13:40:00. Assume somone gets payed for 50 $ an hour, I want to create a formula to compute how much he has earned in that time.
Now if found here that
To convert a time to a number of hours, multiply by 24
So in this case the formula would be simply
= D19 * 24 * 50
However the formula
= D19 * 24
returns -10,33333.... The format of the cell where I entered the formula is a number -> standard. Why is it returning a negative number?
When you multiply 13:40:00 by 24 you get 13.67, so when you take 13.67 and subtract 24 (which is one day) you get -10.33333 which is a value you got.
Are you sure you aren't subtracting one day from the value that you calculate? That would be the logical explanation.

Subtract hours and minutes from a time entered in Excel 2013 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I want to know the time when 12 hrs and 30 mins is subtracted from a time let us say 10:00 AM(it should display 9:30 PM). But since excel by default stores this date as 1st Jan 1990, I am getting a negative timing and excel does not display it. How do I make sure that when a time is entered in a cell,I can subtract certain hours from it and display the time in AM/PM format? PS: I tried changing it to 1904 format,but this did not help.
I think it's enough to put
=MOD(A2-B2,1)
where the first time is in A2 and the second in B2.
That will get the fraction part (the hours) and give it a positive sign which should be what you want.

Running Total + % Of (PivotTable) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I have a table:
Group 0 Group 1 Group 2
Day 1 10 12 9
Day 2 7 5 14
Day 3 12 11 3
...
I want to calculate running total for Groups 1 and 2 as % of running total of Group 0:
Group 0 Group 1 Group 2
Day 1 100% 120% 90%
Day 2 100% 100% 135%
Day 3 100% 97% 90%
...
A pivot table allows to "Show Value As" either running total or % of, but I can't figure out how to have both.
I doubt possible even in Excel 2010 (which I don't have) but the values you show are achievable with the PivotTable showing running totals and (if Day1 is in E4) =F4/$F4 alongside and copied down and across to suit.

Excel equations using months [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am trying to come up with an equation. Here is what I am trying to do. I am trying to get a running total by multiplying a monthly rate for renting something that will at all times keep a running total at all times. Monthly rate x month started = Running total. Keep in mind there doesn't need to be a total based on the number of days owned on a month (Not to be pro-rated in other words.) Something like if it cost $100 a month in January. Then by July 1st you would owe $600. On June 15th for example you would still only owe $500 because the month hasn't ended. In other words the running total would only show completed month totals. Maybe I don't have the best knowledge of excel but I am ok at the equations. The problem is from using months instead of simply multiplying numbers. Any help would be appreciated. Thanks.
My approach to this would be to have dates in one column like '01/Jan/2013', '01/Feb/2013' etc. then the next column would have the formula of = 100 + CellAbove
Use DateDif or Month
= DATEDIF ( start_date , end_date , "interval")
so to calc the months from January to July using Months try this
=DateDif("1/11/2013", '6/1/2013"), "M") will yield 4
=DateDif("1/01/2013", '6/1/2013"), "M") will yield 5
=Month("1/11/2013") - MONTH("6/1/2013") will yield -5
=Month("6/1/2013") - MONTH("1/1/2013") will yield 5
Substitute the References in place of my Direct Dates. i.e.
A1 = "6/1/2013"
A2 = "1/1/2013"
A3 = "=MONTH(A1)-Month(A2)"
See what works for you!
Steve

Cron job run every x weeks and on specific days [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I want to create a cron job that runs every x weeks and on a specific weekdays.
for example: run every 2 weeks on midnight every Sunday and Monday.
the cron expression is stored for every "plan" and i use ncrontab function in SQL Server 2008 to generate the dates of given cron expression.
Is there an expression for it? or even join of several expressions?
I've tried to use the following expression, but it always gives the the same days in months
0 0 1/14 * *
2012-01-01 00:00:00.000
2012-01-15 00:00:00.000
2012-01-29 00:00:00.000
2012-02-01 00:00:00.000
2012-02-15 00:00:00.000
2012-02-29 00:00:00.000
EDIT:
I was looking for a recurrence of every x days/weeks and the main problem with cron, is that it resets the recurrence to the first day of month every time.
for example, if i start the recurrence on 29th for every 3 days, the next occurrence will be the 1st day of next month.
I've neglected cron for the next solution:
http://www.codeproject.com/Articles/20343/Recurring-Date-Generator-with-Pattern-Coding
try 0 0 * * 0/2,1/2
0 and 1 are Sunday and Monday, and /2 is 'every other'
EDIT:
After more research into cron, the above is incorrect because /2 indicates the step (every other value), so 0/2 is equivalent to 0,2,4,6, and 0/2,1/2 is equivalent to 0,1,2,3,4,5,6,7 which explains why you saw it interpreted as every single day of the week.
In your example above 1/14 means starting with 1st of the month, increment by 14, yielding 1,15,29
That being said, if this were for a *nix crontab, then you could've been more granular about the schedule by having something like 0 0 * * Sun,Mon check_if_should_run.sh && the_script_to_run.sh. Using Ncrontab, I can't think of a way to set up every-other-week scenario.

Resources