function backup_tool_cron($hook, $entity_type, $returnvalue, $params) { elgg_load_library("backup_tool"); $backup_options = unserialize(elgg_get_plugin_setting('backup_options', 'backup-tool')); $filename = backup_tool_create_backup($backup_options); //get path to default backup dir specified in plugin settings $backup_dir = elgg_get_plugin_setting('backup_dir', 'backup-tool'); //get ftp settings $ftp_enable = elgg_get_plugin_setting('ftp_enable', 'backup-tool'); if ($ftp_enable == "ON") { //connect to remote ftp server backup_tool_upload_to_ftp($filename); } return $returnvalue; }
<?php /* * Create a new backup file */ elgg_load_library("backup_tool"); $backup_options = get_input("backup_options"); if ($filename = backup_tool_create_backup($backup_options)) { system_messages(elgg_echo("backup-tool:create:success", array($filename))); } else { register_error(elgg_echo("backup-tool:create:fail")); } exit;