DEV Community

Erhan Kılıç
Erhan Kılıç

Posted on

Php ZipMaster - Zip files and folders with php

Hello to everyone. This is my first article. If there are any mistakes, please do not look up.

Compressing files in PHP and creating a zip file is easy, but the situation changes when you include folders into the job. You may want to automatically back up the files on your server like me and you may want to have a solution for it. I have a vps with a lot of sites and I want these sites to be automatically backed up. My solution is to write a script in PHP creates a cronjob.

It is simple to use and you can use it as you like. Please do not hesitate if you want to improve.

Sample use;

<?php

include 'ZipMaster.php';

$zip = new ZipMaster\ZipMaster('backup/test.zip', 'test_folder');
$zip->archive();

You can reach the project here.

Top comments (0)