Search Postgresql Archives

Re: Need help with db script, and daily routines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Peter Neu wrote:
Thanks. This script looks good. :o)
How do I call it once a day with a cron job on my linux box?

Put the script in a file (e.g. expiry_script.sql) then add to your crontab:

/path/to/psql -U <username> -d <database> -f /path/to/expiry_script.sql -q

See man psql, man 5 crontab for more details.

Oh, you might want to read up on the .pgpass file too - that will give you a safe place to store your passwords.

--
  Richard Huxton
  Archonet Ltd


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux