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 $ftp = get_input('ftp'); elgg_load_library('backup_tool'); backup_tool_upload_to_ftp(NULL, $ftp); //echo "success"; exit;