Uploading and downloading files is a chore every webmaster has to cope with on daily basis, but if you do this by compressing the files, uploading the tar or zipped and uncompressing them on server, life becomes a little easier.
Similarly taking backup on a server becomes easier if you just compress the files/folder on server and download the tar.gz file. Usually these commands are run over SSH, but if you do not have SSH access, you can place the commands in php script too.
How to tar/compress folder using php script
if(system("tar -czvf your-fine.tar.gz your-directory/"))
echo '
Directory compressed successfully!';
else echo '
No Donuts for you :(,
command has been disabled by host!';
How to untar/uncompress file using php script
Here is how you can easily uncompress your file, just put the following code in php file:
if(system("tar -zxvf your-file.tar.gz"))
echo '
file uncompressed successfully!';
else echo '
No Donuts for you :(,
command has been disabled by host!';
I hope that saves some bandwidth and time!
Cheers
It should be called “using Linux Shell/Bash”
Thanks for sharing!