I can run commands like vacuumdb, pg_dump, and psql just fine in a script if I preface them like so:
/usr/bin/sudo -u postgres /usr/bin/pg_dump -Fc mydatabase &g
Your environment variable are maybe not set in cron.
In your normal session, you probably have defined these variables:
PG_PORT PG_HOST PG_DATABASE PG_USERNAME PG_PASSWORD
Add an "env" into yout script.