[rt-users] how to run new rt cli in cron

Tom Lahti toml at bitstatement.net
Mon May 4 13:24:59 EDT 2009


> How do I by pass the password prompt? Is there another user I can use 
> instead where I don't have to feed a password thru cronjob?

You do not need an expect script or to feed the password to the CLI's 
STDIN at all.  All you need is to arrange for the environment variables 
RTUSER, RTSERVER and RTPASSWD to be set in your environment before 
calling the CLI, like so:

#!/bin/sh

export RTUSER=someone
export RTPASSWD=Something
export RTSERVER=https://rt.server.com/

/opt/rt3/bin/rt show ticket/123

--------------

If you are parsing the output of the CLI, you're better off using the 
REST interface instead.  The CLI's output changes from version to 
version, which will throw off your parse.  The REST output won't change.

See http://wiki.bestpractical.com/view/REST

--
Tom Lahti






More information about the rt-users mailing list