in reply to Re^2: Postgresql output to file
in thread Postgresql output to file
I need it to run as a cron job every night at 23:59, and add the date as the filename.
That's easy with a shell script. Replace -o /home/user/date.txt with -o "/home/user/$(date '+%m%d%Y').txt". Replace the format string passed to the date command with '+%Y%m%d' to get easily sortable file names instead of that M/D/Y mess.
(Yes, I prefer using perl over shell, but sometimes, the shell is just more efficient.)
Alexander
|
|---|