Hi,
I have a shell script containing multiple PSQL
queries for which I want the output to be redirected to a text file.
psql -U postgres -d database -o textfile.txt << EOF
Query1;
Query2;
Query ....;
EOF
When executing the script, queries outputs are directed to textfile.txt, however when script was set in cron
, textfile.txt is not being updated.
Does anyone have a different way how I can output query results to a text file.