Closed (fixed)
Project:
Backup and Migrate
Version:
7.x-2.2
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Mar 2012 at 08:23 UTC
Updated:
24 Apr 2012 at 20:31 UTC
Hello,
I'm trying to add a backup migrate schedule into an installation profile.
I'm using the code below, but it isn't working. Can anyone help with this?
<?php
$schedule = array(
'name' => t('Default schedule'),
'profile_id' => 'default',
'enabled' => 1,
'destination_id' => 'scheduled',
'period' => 86400,
'keep' => 7,
);
$schedule = backup_migrate_crud_create_item('schedule', $schedule);
$schedule->save();
?>
Comments
Comment #1
jamesmorrish commentedDid you ever get this to work?
I managed it by adding this line above your code:
require_once('sites/all/modules/contrib/backup_migrate/includes/crud.inc');
Comment #2
iancawthorne commentedMany thanks for commenting on this, I hadn't got it working until now, and adding in that extra line has done the trick! Thank you very much.