I'm attempting to back up a directory using PHP's system() function. My code looks something like this:
$command='tar -cvzf /home/my_username/backups/backed_up_files.tar.gz /home/my_username/public_html/files_to_be_backed_up';
if (system($command) === FALSE) {
$status="Error';
} else {
$status='Success';
}
echo $status;
What happens is this - the archive isn't created, I get neither an error or success message, and the process's CPU usage shoots up to about 50%, and stays there until I kill it manually.
I'm fairly new to using system(), so it could well be the case that I'm unaware of something. Any ideas?


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks