$patch = "/path/";
$excludefile = $patch.'*.gz';
$filebackup = date("d-m-Y-H-i-s") .'.tar.gz';
shell_exec("tar cvfz ".$filebackup." ".$patch." --exclude=".$filebackup." --exclude=".$excludefile."");
filesize($filebackup);
Warning: filesize(): stat failed for 07-11-2019-18-09-33.tar.gz in