Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only the hourly jobs are executed since v1.3.0 #326

Closed
HenryRc0 opened this issue Oct 13, 2018 · 8 comments
Closed

Only the hourly jobs are executed since v1.3.0 #326

HenryRc0 opened this issue Oct 13, 2018 · 8 comments

Comments

@HenryRc0
Copy link

Hi,

since v1.3.0 only the hourly jobs are scheduled (and sync first).
All others in the same policy (dailys and weekleys) aren´t scheduled any more.

from logs:
RunJobCommand Running "/usr/bin/rsnapshot" -c "/tmp/rsnapshot.2_2.cfg" sync 2>&1
RunJobCommand Running "/usr/bin/rsnapshot" -c "/tmp/rsnapshot.2_2.cfg" Hourly 2>&1

no errors or warnings within the logs
There is just no RunJobCommand for Daily and Weekly

@xezpeleta
Copy link
Contributor

xezpeleta commented Oct 14, 2018

Confirmed. I see the following line in the log file:

[2018-10-14 16:41:58] BnvWeb.WARNING: There are jobs remaining but their configuration does not allow to execute them {"source":"TickCommand"}

EDIT: this warning messages seems like a different issue. I've opened a new ticket #328

Thanks for your feedback @HenryRc0 . We're gonna try to fix it ASAP!

@HenryRc0
Copy link
Author

I am not a php programmer, but I don´t think this results from the TickCommand.
For me it looks like this is coming from RunJobCommand.

In line 44
$retains = $policy->getRetains();
gets all retains - but then in line 49
$retainsToRun = array($retains[0][0]);
sets the first one to $retainsToRun (in my case Hourly)
line 50 executes this
$result = $this->runJob($job, $retainsToRun);

within runJob (line 144-150)
$commands = array();
if ($job->getPolicy()->mustSync($retain)) {
$commands[] = sprintf('"%s" -c "%s" sync 2>&1', $rsnapshot, $confFileName);
}
$commands[] = sprintf('"%s" -c "%s" %s 2>&1', $rsnapshot, $confFileName, $retain);
$i=0; # Command number. Will be appended to the logfile name.
foreach ($commands as $command) {

the last foreach runs once (without sync first) or twice - with sync but not for all the outher possible retains as Daily, Weekly,...

But then again - php is not my programming language - I could have missread something..

@igorbga
Copy link

igorbga commented Oct 14, 2018

Is It the scheduled job the same form both policies?
In 1.3 policies just enqueue pending jobs in a queue table and i think that duplicate jobs are not allowed As we thougth that there isn't any point in repeating the same backup twice at same point in time.
If this is the case maybe we should reconsider it and take applied policy As a value to discriminate jobs. Or maybe set a priority parameter for policies in order to skip hourly backups in favour of the daily, weekly, monthly and so on...

@HenryRc0
Copy link
Author

@igorbga: In my testing this didn´t mather.
Examples:
policy hourly at 12:00h and daily at 12:00h
at 12:00h hourly gets executed (no daily)
policy hourly at 12:00h and dtaily at 13:00h
at 12:00h hourly gets executed
at 13:00h hourly gets executed (daily never)

@xezpeleta
Copy link
Contributor

Is It the scheduled job the same form both policies?

@igorbga one job, one policy. The policy has enabled different retain levels (hourly, daily, weekly...).

After the upgrade to 1.3.0, only the first one is executed.

@HenryRc0
Copy link
Author

@xezpeleta I merged commit 11ced18 manually here
works as expected again.

I will merge the other ones later (for on demand...)
If something arises here I will comment again

thx

@xezpeleta
Copy link
Contributor

@HenryRc0

Please apply the last commits in the PR. You can obtain the final patch directly from https://patch-diff.githubusercontent.com/raw/elkarbackup/elkarbackup/pull/327.patch

@xezpeleta
Copy link
Contributor

This bug has been fixed in v.1.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants