Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2002
    Posts
    7

    Unanswered: cron jobs for views in postgresql

    I need to know how to get the results of a query into text file,on regular basis using a cron scrpit?

    any suggestions?

  2. #2
    Join Date
    Mar 2002
    Location
    Pilipinas
    Posts
    36

    Red face

    is it possible to use cron for making database backup and vaccum?
    can u guys give me some hints and tips... or u can show me the details if u want...
    --- Hey! its me!!! the MaleMan ---

  3. #3
    Join Date
    Mar 2002
    Posts
    9
    Of couse,

    check man crontab, this command line program allows the program schedule task.

    Only made a bash script saving the postgres envionment and you can run whatever postgres command.

    BTW, if you want to save sql result into text file, you could run something like:
    psql mydb <<!
    select * from pg_user
    ! > file.txt 2> error.log
    or
    echo "select * from pg_user" | psql mydb > file.txt 2> error.log


    Salu lulu.







    Originally posted by MaleMan
    is it possible to use cron for making database backup and vaccum?
    can u guys give me some hints and tips... or u can show me the details if u want...

  4. #4
    Join Date
    Mar 2002
    Location
    Pilipinas
    Posts
    36

    Talking

    THANX for the help...
    --- Hey! its me!!! the MaleMan ---

  5. #5
    Join Date
    Mar 2002
    Posts
    7
    Thanks for the suggestions.....


    Montfort.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •