Quote:
Originally Posted by Tinkster
Assuming that you only want to exclude tar's that live in /
Code:
ls *tar > /exclusions
echo exclusions >> /exclusions
tar -X /exclusions -cvf ./* backup.tar
If you want to exclude ANY tar anywhere in the file-system:
Code:
find / -type f -name \*.tar.\* > /exclusions
echo exclusions >> /exclusions
tar -X /exclusions -cvf ./* backup.tar
Cheers,
Tink
|
I spoke too soon. I am trying to do this backup via a php script that is run from the command line (not as the apache user).
I am running the code using the php exec() function as:
Code:
exec("ls *tar > /exclusions");
exec("echo exclusions >> /exclusions");
exec("tar -X /exclusions -cvf $destfile ./*");
and here is the result:
Code:
sh: /exclusions: Permission denied
sh: /exclusions: Permission denied
tar: /exclusions: No such file or directory
tar: Error is not recoverable: exiting now
Clearly the logged in user does not have permission to write the result of the ls to /exclusions
Any ideas?