Created
January 15, 2015 10:29
-
-
Save JunaidQadirB/2dda6fe54064c6167579 to your computer and use it in GitHub Desktop.
Compress Files on your host if you don't have cpanel or ssh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$time_stamp=time(); | |
/* | |
* Set $archive and $directory path accordinging to your host | |
*/ | |
$archive = "../tmp/backup_{$time_stamp}.tar"; | |
$directory = "../html/"; | |
print "starting..."; | |
exec( "tar cf $archive $directory 2>&1 ",$retArr, $retVal); | |
// print_r($retArr); | |
// print_r($retVal); | |
exec( "gzip $archive 2>&1",$retArr, $retVal); | |
// print_r($retArr); | |
// print_r($retVal); | |
print "Done."; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment