One possible part of a cron script:
su --command="psql -d $PGUSER -c 'vacuum analyze;' > /dev/null" $PGUSER
where 'PGUSER' has been defined as the appropriate user name. Of course,
you'll need a bit more if your database has a different name.
HTH...
-frank