Poll: Do you use the database backup feature?
You do not have permission to vote in this poll.
Yes
40.00%
34 40.00%
No
60.00%
51 60.00%
Total 85 vote(s) 100%
* You voted for this item. [Show Results]

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How often do you use the backup() method of the database drivers?

#27
Smile 
(02-06-2019, 09:50 PM)kilishan Wrote: The Mysql driver in CodeIgniter (I think that's the only one) has a backup feature. Do you ever use this feature? Thinking of dropping it from CI4.

me, using till now, my client and I need to take backup manually every week, 
sometimes we use it in crone and push to our cloud, its really a helpful feature for me and my team Smile 

     
Code:
       $this->load->helper('url');
        $this->load->helper('file');
        $this->load->helper('download');
        $this->load->library('zip');
        $this->load->dbutil();
        $db_format = array('format' => 'zip', 'filename' => 'my_db_backup.sql');
        $backup = &$this->dbutil->backup($db_format);
        $dbname = 'backup-on-' . date('Y-m-d') . '.zip';
        $save = 'backup/' . $dbname;
        write_file($save, $backup);
        force_download($dbname, $backup);
Heart Heart Heart Heart Heart
Reply


Messages In This Thread
RE: How often do you use the backup() method of the database drivers? - by jijin - 02-21-2019, 11:04 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.