|
Posted by Tyrone Slothrop on 09/29/05 16:44
On Thu, 29 Sep 2005 08:46:29 +0200, "Bruno" <bruno_storz@gmx.de>
wrote:
>Hi there,
>
>I want to save / zip a web account from it's root via a php script.
>
>Sorry for asking - because I have a very low internet link on my vacation
>place and I have found out, that some hackers try tor "erase" some files now
>and then. Changing password did not lead to a success so far.
>
>So, if YOU have a URL or a script which COPIES or ZIPs all files including
>subdirectories, you would really help me.
>
>Thanks
>Bruno
Bruno:
There is nothing much to backing up a directory. I am assuming that
you are on a Linux server.
$dir = "/path/to/dir2backup";
$filename = "backup";
$date = date ('Y-m-d');
bu_dir = "/path/to/backup/dir";
chdir ($bu_dir);
if (is_dir ($dir))
{
system ("tar -zcf $filename.$date.tar.gz $dir");
system ("chmod 666 $filename.$date.tar.gz");
}
Navigation:
[Reply to this message]
|