So I have a client who's current host does not allow me to use tar via exec()/passthru()/ect and I need to backup the site periodicly and programmaticly so is there a solution?
This is a linux server.
So I have a client who's current host does not allow me to use tar via exec()/passthru()/ect and I need to backup the site periodicly and programmaticly so is there a solution?
This is a linux server.
There is the Archive_Tar library. If that can't be used for some reason, the zip extension might be another option.
PHP 5.3 offers a much easier way to solve this issue.
Look here: http://www.php.net/manual/en/phardata.buildfromdirectory.php
I need a solution that would work on Azure websites (IIS) and had trouble with creating new files on the server using methods from other answers. The solution that worked for me was to use small TbsZip library for compression, which doesn't require to write file anywhere in the server - it's just returned directly via HTTP.
This thread is old, but this approach might be a bit more generic and complete answer, so I post the code as alternative:
And here's the whole article on my blog.
At http://pear.php.net/package/Archive_Tar you can donload the PEAR tar package and use it like this to create the archive: