backup server or website media php package
From your terminal:
composer require taymaz/mediabackup
This starts to install mediabackup package its working with composer so you can use it to easy.
for starting you need to create a file named config to setup backup options like directories and backup export path and ...
Set your own particular config
{
"Directories": [
"media",
".",
"media/thumbnails"
],
"BackupExportPath": "."
}
require package in your php file
use Taymaz\Mediabackup\Mediabackup;
and give config file path then get your backup file path in clallback function
Mediabackup::configFile("./config.json")->CreateBackup(function($backup){
echo $backup->path;
});
$backup
methodes you can use :
$backup->remove(); //true
$backup->filename; //backup-2023-01-15.zip