Welcome Guest, Not a member yet? Register   Sign In
cron command doesn't work in contropanel
#1

[eluser]yusuf[/eluser]
Hello CI Expert
I have developed a cron controller. i have set up a command like
0 13 * * * wget http://host.com/application/cron/backup 2>&1
but not work.
i am trouble please reply asap.
#2

[eluser]misplacedme[/eluser]
I don't know what your backup script does.
If it outputs the data it gets and has wget save it, you need to tell wget the path to save it at using the -O switch.
If the backup script saves the data in a specific place using the controller, then check your email messages for errors.
The easiest way to make sure it works is to go to a couple random directory and run the command and see what happens.
#3

[eluser]yusuf[/eluser]
misplacedme,

Thanks for your reply. corn was used for backup, remainder etc

backup script is

function backup()
{
// Set memory_limit to -1 so we won't get errors.
ini_set('memory_limit', '120m');
ini_set('display_errors',1);
error_reporting(E_STRICT);

$this->load->dbutil();
$backup =& $this->dbutil->backup();

// Load the file helper and write the file to your server
$this->load->helper('file');
var_dump(write_file('backups/dbbak' . date('Y-m-d') . '.gz', $backup));

// Load the download helper and send the file to your desktop
$this->load->helper('download');
}

is there any error please reply me
#4

[eluser]misplacedme[/eluser]
I don't see any obvious errors. What happens when you access the webpage? And what happens when you run it from the command line?
#5

[eluser]yusuf[/eluser]
it doesn't show any file in the directory.
#6

[eluser]misplacedme[/eluser]
I'm doubting it is the backup utility giving you problems.
Check the permissions on the backup folder.
Either change the owner of the folder to the webserver username(usually "nobody" or "www-access")
or change the permissions of the folder to at least 666 (RW for owner, group, and public).




Theme © iAndrew 2016 - Forum software by © MyBB