Welcome Guest, Not a member yet? Register   Sign In
Problem with the ZIP library under linux
#1

[eluser]Miroslav Vitanov[/eluser]
Hello all,
I've just completed a backup module for my site. Under Windows (win7) there are no problems, but when I uploaded it to my server (linux) I encountered the following problem: when I'm zipping only the SQL file everything is OK and I can open the file, but when I use
Code:
$this->zip->read_dir('uploads/');
the file opens but there is nothing in it.

Here is my function for creating the backup:
Code:
function doBackup($backup_dir = 'backups')
    {
        if($this->session->userdata('is_logged') == TRUE && $this->users_model->hasAccess('backup'))
        {
            // Зареждане на библиотеката за създаване на архиви
            $this->load->library('zip');
            // Зареждане на класа за архивиране на БД
            $this->load->dbutil();
            // Опции за архива с базата данни
            $config = array(
                'format' => 'zip',
                'filename' => 'sql_backup.sql'
            );
            // Създаване на бекъпа
            $backup =& $this->dbutil->backup($config);
            // Задаване на бекъпа към архива
            $this->zip->add_data($backup);
            // Задаване на папки за архивиране, в случая папката uploads
            $this->zip->read_dir('uploads/');
            // Създаване на архива и връщане на стойност TRUE/FALSE за потребителя
            return $this->zip->archive($backup_dir.'/fullbackup_'.date('d-m-Y').'.zip');
        }
        return FALSE;
    }

Thank you for your help in advance!
#2

[eluser]InsiteFX[/eluser]
Linux is case sensitive make sure all filenames are lowercase.

InsiteFX
#3

[eluser]Miroslav Vitanov[/eluser]
[quote author="InsiteFX" date="1299464346"]Linux is case sensitive make sure all filenames are lowercase.

InsiteFX[/quote]When I made all filenames to lowercase there was no diffrence. Any other suggestions?
#4

[eluser]InsiteFX[/eluser]
Try giving add_data a $name.
Code:
$this->zip->add_data($name, $backup);

InsiteFX
#5

[eluser]Miroslav Vitanov[/eluser]
[quote author="InsiteFX" date="1299467422"]Try giving add_data a $name.
Code:
$this->zip->add_data($name, $backup);

InsiteFX[/quote]That worked. Thank you for the help.




Theme © iAndrew 2016 - Forum software by © MyBB