I create two files:
D:yourquery.sql
select DailyReport();
D:PG_JobsPgsql_Daily.bat
@echo off
echo.
set PGUSER=your_username
set PGPASSWORD=your_password
C:UserAdminPostgreSQL9.1binpsql --host=192.168.XXX.XXX --dbname dbname --port=5432 --file=D:yourquery.sql
echo.
echo.
pause
Then create schedule job:
schtasks /Create /SC DAILY /ST 00:00:00 /TN Pgsql_DailyJob /RU “NT AUTHORITYSYSTEM” /TR D:PG_JobsPgsql_Daily.bat
I intended to put you a very little remark to say thanks a lot again relating to the fantastic things you've shown on this site. This has been simply unbelievably generous of you giving without restraint all most people would have marketed as an ebook to help make some dough for themselves, mostly considering the fact that you could possibly have tried it in the event you desired. These solutions likewise worked to provide a easy way to be sure that other people have a similar interest much like my personal own to learn way more concerning this problem. I'm sure there are some more fun instances in the future for individuals who look over your blog post.
ReplyDeleteThanks for the nice comment.
ReplyDeleteThese all happens on my daily works.
After 10 years I learn all the tricks from internet, I feel it is time to pay back.
Best Regards,
Wow! Thank you! I always wanted to write on my site something like that. Can I implement a portion of your post to my website?
ReplyDeleteSure, please do.
ReplyDelete