* Thus wrote Tom Ray [List] ([EMAIL PROTECTED]):
> I'm having a bit of an issue using exec() and system().

hmm.. seems to be the theme today :)

> 
> $dir="unique_dir";
> system("cp -R forum /path/of/forum/location/of/forums/".escapeshellarg($dir));
> 
> The forum directory is located in the same directory as the script.
> 
> Now, this is where I run into trouble. When they delete directories, I want to 
> backup the directory before I delete it
> just in case they delete the wrong information. I just can't get it to work. I've 
> tried exec() and system() to no avail.
> Of course, I'm under the impression I can use tar via exec(). Currently I have:

This depends, if safe_mode is on, tar may or may not be allowed
depending on the safe_mode settings.

Also, tar may not be in your path, try calling tar directly: 
  /usr/bin/tar [options]


> $dir="unique_dir";
> $cmd="tar -cf /location/of/tar/files/$dir.tar /location/of/forum/diretory/*";
> exec($cmd);

Just a side note, you might want to issue a:
   tar -czf /location/of/tar/files/$dir.tgz

Probably will samve some space down the line.


> 
> This should work shouldn't? Any thoughts, suggestions? Anyone else done something 
> like this?

Yes, another thing to check for would be any error's that are
issued from the exec($cmd).
 

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to