You do NOT need to shut down the master database to perform this operation
makebaseline.sh:
#!/bin/sh

# Creates an archive with base directory 'main' that
# can be unpacked into the data directory on the standby system
export DATA=/var/lib/postgresql/8.4/

echo "SELECT pg_start_backup('backuplabel');" | psql

# Exclude the contents of the pg_xlog directory from the tarball as it contains
# WAL files which will be copied to the slave/standby database server
# using the archive_command. We just want to make a baseline copy
# to which subsequent WAL files will be applied.
tar -czf baseline.tgz  -C ${DATA} --exclude='pg_xlog/*' main

echo "SELECT pg_stop_backup();" | psql