tar: Howto Exclude or Include Files

Recently I’ve had a little problem. I’ve needed to create an archive from some source directories but I’ve not needed to add in the archive some subdirectorives. I’ve made a quick search in Google and found an article “Telling tar Which Files to Exclude or Include”. Here is a short example:


$ find videoguide/ ! -type d -print | egrep '/,|%$|~$|.jpg$|.gif$|.png$' > /tmp/exclude_files

That command forms a list of excluded files and store it into temporary file.

$ tar vcfX ~/projects/arc/vg-19012004.tar /tmp/exclude_files

will remove files which listed into excluded_files from archive.

Updated: There is a more simple way to exclude file/dir from the archive. You can define a pattern in the command line instead of creation a file. Let’s image that we need to exclude Subversion directories from the archive:
tar vzcf my-project.tar.gz --exclude='.svn' ProjectDir
Note: you should always wrap the pattern by quotes!

PostgreSQL 8.0.0 Released

The PostgreSQL Global Development Group has announced the release of version 8.0.0 of the PostgreSQL ORDBMS.
Changes:
– Native Windows port
– Savepoints/nested transactions
– Exception handling inside functions
– Tablespaces
– Point in time recovery
– Improved shared buffer management
– Background writer process to reduce checkpoint impact
– Tunable delays to reduce the impact of VACUUM
– Overhaul of pg_dump and pg_restore
– Expanded log format options and log rotation
– Improved embedded quote handling for functions
– ALTER TABLE can alter the data type of an existing column
– Improved ALTER capabilities for all database objects