I'm using backup_migrate for quite some time on several sites.

On one site, I just saw, that the scheduled backup runs twice, everytime the schedule gets active (see attached image). As you can see, that was not the case, when it ran the first time.

Ideas?

EG

CommentFileSizeAuthor
#5 backup-migrate-cron-re-run.jpg65.2 KBosox
#3 Clip_2.jpg57.87 KBpremanup
#3 Clip_3.jpg27.84 KBpremanup
backup.png7.09 KBAnonymous (not verified)

Comments

ronan’s picture

Version: 6.x-1.2 » 6.x-2.2
Status: Active » Postponed (maintainer needs more info)

IS this happening with the 2.x branch?

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Sorry, I can't remember on which site this problem occured. Maybe it's gone with 6.x-2.2. I'll re-open the issue, if it comes up again.

premanup’s picture

Version: 6.x-2.2 » 6.x-2.4
Status: Closed (fixed) » Active
StatusFileSize
new27.84 KB
new57.87 KB

I deleted old schedule and create a new one. After this schedule starts run twice every night. See attachment.
Cron runs every 10 min. Using last version Backup and Migrate 2.4
Due to the fact DB is quite big (200Mb) backup takes ~ 497604.58 ms.

premanup’s picture

After changing compresion mode from GZip to No_compression module works smoothly.

osox’s picture

Version: 6.x-2.4 » 7.x-2.1
StatusFileSize
new65.2 KB

This happens with Drupal 7 and 2.1 version of Backup and Migrate module as well.

ronan’s picture

Status: Active » Postponed (maintainer needs more info)

Does everybody who has this problem have a high cron rate and large db? The run times listed in premanups is approaching the cron frequency so it's possible that he next cron job is starting before the first one ends.

pjcdawkins’s picture

I have the same problem. It's a large database, and cron is called frequently, but I'm using Elysia Cron to only run backup_migrate_cron once a day.

I get two backups every night at the same time, or at least within a minute of each other. The first succeeds, the second fails with a time out.

Actually, it's probably time I changed the site's cron from HTTP to CLI.

[edit: backup takes on average around 10 minutes]

[edit: now that the cron job is run via Drush rather than HTTP, it's working fine]

ronan’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (fixed)

I think this should be fixed in the latest dev, but reopen if not.

sin@’s picture

unfortunately 7.x-2.1 still has the same issue.
No matter how and when I set the Elysia settings, not only it runs any time it wants (I think it is as soon as Admin logs in to the site), it also runs multiple times. some days twice, some days 4 times in a row bringing the whole site to its knees.
current setting is : 0 22 * * 0-6
Version: 7.x-2.1
backup takes 5 minutes now but this will be longer and longer by the time DB gets bigger and we just have to sit and wait until it decides to stop getting DB backups.
I am tempted to use #4 suggestion on 'changing compression mode from GZip to No_compression' but hate to create big uncompressed files. changed it to 'zip' for now just in case anything changes.

sin@’s picture

Status: Closed (fixed) » Active
pefferen’s picture

@sin You probably have cron running on drupal cron aswell. This mechanism is triggerd by users vititing your site. Read more about this here https://www.drupal.org/cron

pefferen’s picture

Status: Active » Closed (fixed)
sin@’s picture

@pefferen: Thanks a lot for your reply. Does this mean that I can disable the cron as said in that link and then Elysia will trigger the cron as an external trigger and it will cause it to run on set schedule?

(Right now it is set to .zip instead of .gz) Disabling the automatic cron I noticed that there are lot of other services that need it so I thought I would disable backup related ones:
I see a few which are the ones I have added as scheduled backups under backup and migrate settings with the correct times shown, but there is also one that does not show any where else (my guess is that it came with the module installation maybe):

It's called: 'backup_migrate_cron' and is scheduled for every hour! I disabled it to see if it will stop backing up the DB as soon as admin logs in in the morning. I'll post the result.

sin@’s picture

So here is the report:

Changing gzip to zip as said in #4 does not make a difference in the way the module works.

Also disabling 'backup_migrate_cron' from cron settings did not make any difference, it actually made it worst, back up ran 9 or 10 times in a row without us being able to control it as soon as admin logged in.

I then disabled cron for all backup and migrate tasks and of course it didn't run at all.
So following yout link I get to: Administration > Configuration > System > Cron but not sure what to disable so the elysia cron still runs.
You said: "You probably have cron running on drupal cron aswell." which item on the big list of crons is drupal cron to disable? I see a 'backup_migrate_cron', the rest of the backup items I have added and the lots of other cron jobs that are not backup related.
Thanks.

pjcdawkins’s picture

This all suggests that there is a race condition, and so some sort of lock should be held by B&M while it is backing up... using the lock_acquire() function, etc.

sin@’s picture

Yeah, the module's cron actions are completely out of control, it brought our site down yesterday as it takes over DB any time it wants and starts backing up a few times in a row! I disabled all the scheduled tasks and crons related to it.
We never got a full backup either (files and DB) with it as it was never doing it right, it was only meant for a DB backup but I guess we would be better off disabling the module for now.