I have read three posts and the man page for gnu tar and still can not figure out how to do this. Here is my directory structure:
Code:
(monitor):root 0# find phpmon/
phpmon/
phpmon/images
phpmon/images/logo.gif
phpmon/images/edit.gif
phpmon/dont_need
phpmon/dont_need/socktest.php
phpmon/dont_need/xml-stuff.php
phpmon/dont_need/init.new.php
phpmon/dont_need/newinit.php
phpmon/dont_need/regtest.php
phpmon/dont_need/class_path_parser
phpmon/dont_need/class_path_parser/class_path_parser.php
phpmon/dont_need/class_path_parser/foo.xml
phpmon/dont_need/class_path_parser/main.css
phpmon/dont_need/add_host.php
phpmon/index.php
phpmon/view_xml.php
phpmon/mon.css
phpmon/maps
phpmon/maps/Clinton
phpmon/maps/KnobNoster
phpmon/maps/LaMonte
phpmon/maps/Marshall
phpmon/maps/Pilot-Grove
phpmon/maps/Sedalia
phpmon/maps/Warrensburg
phpmon/maps/Warsaw
phpmon/view_hosts.php
phpmon/upgrades.txt
phpmon/build
phpmon/build/mon.cf
phpmon/build/config
phpmon/build/config/tempfile
phpmon/view_services.php
phpmon/send_command.php
phpmon/service_settings.php
phpmon/host_settings.php
phpmon/config
phpmon/config/host_config.xml
phpmon/config/blank.xml
phpmon/config/host_config.xml.bak
phpmon/config/all_services.xml
phpmon/city_settings.php
phpmon/add_remove_city.php
phpmon/view_logs.php
phpmon/view_config.php
phpmon/smarty-class
[...]
This command tars everything:
Code:
tar -czv -f phpmon.tar.gz phpmon/
Now, I want to tar this directory excluding the phpmon/config directory. This command will work, but it also excludes the phpmon/build/config directory :
Code:
tar -czv --exclude "config" -f phpmon.tar.gz phpmon/
I have tried all of these commands and none work:
Code:
tar -czv -f phpmon.tar.gz ./phpmon --exclude='./phpmon/config/'
tar -czv -f phpmon.tar.gz ./phpmon --exclude phpmon/config
tar -czv -f phpmon.tar.gz ./phpmon --exclude ./phpmon/config
tar -czv -f phpmon.tar.gz /var/www/html/phpmon --exclude /var/www/html/phpmon/config
tar -czv -f phpmon.tar.gz phpmon --exclude phpmon/config*
tar -czv -f phpmon.tar.gz /var/www/html/phpmon --exclude var/www/html/phpmon/config
I am really at a loss. I can't believe it would be this difficult.