exception to * operator?
I am trying to use the tar command to copy everything in my current directory recursively to a tar file for a backup but I don't want to include any .tar files in the backup. Is there a way to exclude .tar files from a tar command with * being the source file to be copied?
Current command: Code:
tar -cvf ./* backup.tar Looking for something like: Code:
tar -cvf ./* (except *.tar) backup.tar Thanks for the assistance |
Assuming that you only want to exclude tar's that live in /
Code:
ls *tar > /exclusions Code:
find / -type f -name \*.tar.\* > /exclusions Cheers, Tink |
Thanks Tink
|
Quote:
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"); Code:
sh: /exclusions: Permission denied Any ideas? |
Well, /exclusions would be at the root of the partition, where traditionally only root can write.
Create a dir path owned by the relevant user |
Quote:
Thanks to everyone. |
All times are GMT -5. The time now is 10:46 AM. |