Either run the script as system user postgres
- who has a corresponding db user with peer authentication set up, according to your pg_hba.conf
file. Like @Milen already hinted in his comment.
Or set up password-less access for your system user, preferably with a .pgpass
file.
More details in this closely related answer:
PostgreSQL Scheduled Database Backup.
Or this comprehensive answer about password-less access on SO.Or this comprehensive answer about password-less access on SO.