<?php 
class Sitebackup extends CI_Controller
{
	function index()
	{//echo $_SERVER['DOCUMENT_ROOT'].'/backups/';die;
		$this->load->library('zip'); 
	    $path = 'application/'; 
	    $time = time();
	    $this->zip->read_dir($path);  
	    //$result = $this->zip->download('backup.'.$time.'.zip'); 
	    $this->zip->archive('/home/castleevents/backups/backup.'.date('d-m-Y').'.zip'); 
	    return $result;  
	    exit;
	}
}