CodeIgniter Forums

Full Version: using write_file()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using write_file to to write out a backup of my sql tables once/week:


$backup $this->dbutil->backup($prefs);
write_file('/opt/bitnami/mysql/tmp/mybackup.gz'$backup)


$source '/opt/bitnami/mysql/tmp/mybackup.gz';

// Where the files will be transferred to
           $dest 's3://substantiator-mysql-backup';

// Create a default transfer object
           $manager new \Aws\S3\Transfer($client$source$dest);


 
This seems to write out a long string of data to the file named above. The problem is that when i try uploading this to Amazon I get an error that the function can't find /opt/bitnami/mysql/tmp/mybackup.gz .

I checked the permissions of that file and I see it is: 660. 

Is the problem in the way the backup was created? Or perhaps the permissions on the /tmp directory?