I'm currently trying to run a .sh
file which will backup my database.
The initial psql command is as follows:
psql -h "$HOSTNAME" -U "$USERNAME" -W "$PASSWORD" -At -c "$SCHEMA_ONLY_QUERY" postgres
I'm getting the error:
psql: warning: extra command-line argument "postgres" ignored
I'm not sure if I followed the psql documentation properly, because if I remove the -W "$PASSWORD"
part then it suddenly works but I have to enter the password every time.
I want to include the password so that it doesn't ask me for password repeatedly.