AFP548 Changing the world one server at a time.

dump to a file?

Home › Forums › OS X Server and Client Discussion › Misc. › dump to a file?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #360918
    Anonymous
    Guest

    Is there a way to cron job a command that would dump ARDs SQL database to a text file, like a tab delimited file? I am building a Filemaker solution and I want to automate the importing of a text file containing my asset information, but I have to figure out how to automate ARD first.

    Or does anyone know if you can applescript ARD to save reports? It is easy enough to schedule them to happen, but not to get them to save…..

    #360928
    Anonymous
    Guest

    ok using the Apple article,
    http://developer.apple.com/appleapplications/ardsql.html
    and this psql command ref
    http://pgsqld.active-venture.com/app-psql.html

    I wrote the following command.
    ./psql -U ard -d ard -c “COPY systeminformation TO ‘/tmp/ard.txt’ WITH DELIMITER ‘\t’;”

    You must be in the directory /System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin in order to run it.

    The problem is that ./psql is the interactive terminal. It wants you to enter the password after the command. If you do so, then it works great. But if I can’t include the password then I can’t script it into a cron job.

    Any ideas?

    #361437
    boli
    Participant

    call a shellscript from your cron:

    #!/bin/bash

    PGUSER= PGPASSWORD=

    export PGUSER PGPASSWORD


Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.