We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

RE: [Developers] Running the data warehouse cron job on Windows

Hi Jaron,

I think I misunderstood the problem in the first place. But I am glad that you figured it out.

Cheers,
Gem
Sent: Wednesday, June 21, 2006 2:11 PM
To: Gem Yang
Cc: [email protected]; [email protected]
Subject: [Users] RE: [Developers] Running the data warehouse cron job on Windows

Thank you Gem,

Your input was very helpful. I was able to figure out a workaround that works something like this:

Create a batch script with the following line
@echo mypassword|”c:\Program Files\PostgreSQL\8.1\bin\psql.exe” –d openclinica –U clinica –f c:\OpenClinica\OpenClinica-1.1\conf\pg_data_warehouse.sql

I saved this as c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat

And then ran the following commands:
AT 00:00 /every:SUNDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
AT 00:00 /every:MONDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
AT 00:00 /every:TUESDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
AT 00:00 /every:WEDENSDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
AT 00:00 /every:THURSDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
AT 00:00 /every:FRIDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
AT 00:00 /every:SUNDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat

I think you can do this with the GUI as well, and maybe a little easier, but I think the trick is piping the password to the psql process, otherwise it hangs waiting for interactive input.

Thanks again!
- Jaron

From: Gem Yang [mailto:[email protected]]
Sent: Wednesday, June 21, 2006 12:43 PM
To: Jaron Sampson; [email protected]
Cc: [email protected]
Subject: RE: [Developers] Running the data warehouse cron job on Windows

Hi Jaron,

Just found out, you can also use the command line version of “the scheduled tasks”, which is called “schtasks”
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

Thanks.
Gem
Sent: Wednesday, June 21, 2006 12:36 PM
To: 'Jaron Sampson'; [email protected]
Cc: [email protected]
Subject: RE: [Developers] Running the data warehouse cron job on Windows

Hi Jaron,

From control panel/scheduled tasks, you can add the task with a specified user account and password as well as all the scheduling setup.

Hope this helps.

Gem
Sent: Wednesday, June 21, 2006 12:31 PM
To: [email protected]
Cc: [email protected]
Subject: [Developers] Running the data warehouse cron job on Windows

Hi folks,

Our team is in the process of pushing out release 1.1 and hit a snag I am hoping someone can help us with. One of the issues 1.1 will resolve is the Extract Data features not working on Windows, without having to call the OpenClinica\conf\pg_data_warehouse script manually. This is accomplished easily enough on Linux, by adding the following line to crontab:

0 0 * * * /usr/local/pgsql/bin/psql -U clinica -d openclinica -f /var/OpenClinica-1.1/conf/pg_data_warehouse.sql

I have been trying to accomplish the same thing on Windows, using the AT command, which looks something like this:

AT 00:00 /EVERY:SUNDAY "C:\Program Files\PostgreSQL\8.1\bin\psql.exe" -d openclinica -U clinica -f C:\OpenClinica\OpenClinica-1.1\conf\pg_data_warehouse.sql

The problem is, the scheduled task fails because it must prompt interactively for the password. Does anyone know any way around this? Thanks in advance.

Jaron
..................................
Jaron Sampson
Software Engineer
Akaza Research
One Kendall Square
Bldg. 400, 4th Fl
Cambridge, MA 02139
tel: 617.621.8585 x.15
fax: 617.621.0065
Email: [email protected]

Comments

  • gemyanggemyang Posts: 9
    Hi Jaron,

    I think I misunderstood the problem in the first place. But I am glad that you figured it out.

    Cheers,
    Gem
    Sent: Wednesday, June 21, 2006 2:11 PM
    To: Gem Yang
    Cc: [email protected]; [email protected]
    Subject: [Users] RE: [Developers] Running the data warehouse cron job on Windows

    Thank you Gem,

    Your input was very helpful. I was able to figure out a workaround that works something like this:

    Create a batch script with the following line
    @echo mypassword|”c:\Program Files\PostgreSQL\8.1\bin\psql.exe” –d openclinica –U clinica –f c:\OpenClinica\OpenClinica-1.1\conf\pg_data_warehouse.sql

    I saved this as c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat

    And then ran the following commands:
    AT 00:00 /every:SUNDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
    AT 00:00 /every:MONDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
    AT 00:00 /every:TUESDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
    AT 00:00 /every:WEDENSDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
    AT 00:00 /every:THURSDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
    AT 00:00 /every:FRIDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat
    AT 00:00 /every:SUNDAY c:\OpenClinica\OpenClinica-1.1\conf\update.data.warehouse.bat

    I think you can do this with the GUI as well, and maybe a little easier, but I think the trick is piping the password to the psql process, otherwise it hangs waiting for interactive input.

    Thanks again!
    - Jaron

    From: Gem Yang [mailto:[email protected]]
    Sent: Wednesday, June 21, 2006 12:43 PM
    To: Jaron Sampson; [email protected]
    Cc: [email protected]
    Subject: RE: [Developers] Running the data warehouse cron job on Windows

    Hi Jaron,

    Just found out, you can also use the command line version of “the scheduled tasks”, which is called “schtasks”
    http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

    Thanks.
    Gem
    Sent: Wednesday, June 21, 2006 12:36 PM
    To: 'Jaron Sampson'; [email protected]
    Cc: [email protected]
    Subject: RE: [Developers] Running the data warehouse cron job on Windows

    Hi Jaron,

    From control panel/scheduled tasks, you can add the task with a specified user account and password as well as all the scheduling setup.

    Hope this helps.

    Gem
    Sent: Wednesday, June 21, 2006 12:31 PM
    To: [email protected]
    Cc: [email protected]
    Subject: [Developers] Running the data warehouse cron job on Windows

    Hi folks,

    Our team is in the process of pushing out release 1.1 and hit a snag I am hoping someone can help us with. One of the issues 1.1 will resolve is the Extract Data features not working on Windows, without having to call the OpenClinica\conf\pg_data_warehouse script manually. This is accomplished easily enough on Linux, by adding the following line to crontab:

    0 0 * * * /usr/local/pgsql/bin/psql -U clinica -d openclinica -f /var/OpenClinica-1.1/conf/pg_data_warehouse.sql

    I have been trying to accomplish the same thing on Windows, using the AT command, which looks something like this:

    AT 00:00 /EVERY:SUNDAY "C:\Program Files\PostgreSQL\8.1\bin\psql.exe" -d openclinica -U clinica -f C:\OpenClinica\OpenClinica-1.1\conf\pg_data_warehouse.sql

    The problem is, the scheduled task fails because it must prompt interactively for the password. Does anyone know any way around this? Thanks in advance.

    Jaron
    ..................................
    Jaron Sampson
    Software Engineer
    Akaza Research
    One Kendall Square
    Bldg. 400, 4th Fl
    Cambridge, MA 02139
    tel: 617.621.8585 x.15
    fax: 617.621.0065
    Email: [email protected]
This discussion has been closed.