Execution of python  scripts through script tag

I have one line in my xml file :
script language="jython" src="scripts/setup.py"/>
but when i am running this file as ant script file,it is saying that it cannot find the script tag..
It is giving this error:
Ant could not find the task or a class this task relies upon.
This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
- You have misspelt 'script'.
Fix: check your spelling.
- The task needs an external JAR file to execute
and this is not found at the right place in the classpath.
Fix: check the documentation for dependencies.
Fix: declare the task.
- The task is an Ant optional task and optional.jar is absent
Fix: look for optional.jar in ANT_HOME/lib, download if needed
- The task was not built into optional.jar as dependent
libraries were not found at build time.
Fix: look in the JAR to verify, then rebuild with the needed
libraries, or download a release version from apache.org
- The build file was written for a later version of Ant
Fix: upgrade to at least the latest release version of Ant
- The task is not an Ant core or optional task
and needs to be declared using <taskdef>.
Kindly let me know how can i execute this script..

the discussion of the timed maintenance is an old one and does no longer apply.
Sure it does.  Those scripts are ancient carry-overs from the early days of Unix and have not been changed much since then.
Also, macjack has a good point.  Verify what the widget is telling you.  Paste the following command into the Terminal to find out when they last ran:
ls -al /var/log/*.out
The output on my machine is:
Hyperion:~ thomas$ ls -al /var/log/*.out
-rw-r--r--  1 root  wheel  355773 Feb 20 06:05 /var/log/daily.out
-rw-r--r--  1 root  wheel    1352 Feb  1 06:07 /var/log/monthly.out
-rw-r--r--  1 root  wheel    2697 Feb 18 09:31 /var/log/weekly.out

Similar Messages

  • Running Python Scripts through Labwindows/CVI

    Hello,
    I'm trying to execute Python scripts through Labwindows/CVI.  I believe I have the correct library for the code to access in my project. I'm getting errors as it can't find "io.h", "stat.h", or "wchar.h" files.  There is another post on this, where a modified pyconfig.h file was provided, however that file does not work for me.  I'm not sure how to obtain the correct files for what I need here.  Is there any dependable method to do this?
    I'm on Windows 7, I'm running CVI version 9.1.1 and Python 2.6.6 (32-bit).  The library file I'm using was proveded as part of the python install, called "Python26.lib".  I zipped and attached the project, but to get it working you have to download Python (http://www.python.org/download/releases/2.6.6/), and point CVI to the "Python.h" header file (in the "include" directory under the "Python26" directory.
    Attachments:
    Test project.zip ‏4 KB

    Where are these .h files located? If you know where these files are located go to Options>>Environment...>>Include Paths... you can add directories that the workspace will look for include files that are not explicitly included in your project.
    Ian M.
    National Instruments

  • Executing shell script through PL/SQL

    Hi,
    I need some help regarding execution of shell script through Oracle PL/SQL.
    I have a shell script present in /abc/xyz folder with name search.sh , Through a PL/SQL procedure I am creating a file to store the report data.
    I want to execute /abc/xyz/search.sh from the PL/SQL procedure to delete all files created before 3 mins .
    1.     At first I took Java route and got following permissions granted for RECON user.
    GRANT USER SYS java.io.FilePermission <<ALL FILES>> execute ENABLED 351
    GRANT USER SYS java.lang.RuntimePermission readFileDescriptor * ENABLED 350
    GRANT USER SYS java.lang.RuntimePermission writeFileDescriptor * ENABLED 349
    2.     Then I created a simple java class for execution of OS command as below
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "OSCommand" AS
    import java.io.*;
    import java.util.*;
    public class OSCommand{
    public static String Run(String Command){
    try{
    Process proc = Runtime.getRuntime().exec(Command);
    int ext=proc.waitFor();
    return ("0");
    catch (Exception e){
    System.out.println("Error running command: " + Command +
    "\n" + e.getMessage());
    return(e.getMessage());
    3.     And a wrapper function as below to use this class
    create or replace
    FUNCTION OSCommand_Run(Command IN STRING)
    RETURN VARCHAR2 IS
    LANGUAGE JAVA
    NAME 'OSCommand.Run(java.lang.String) return int';
    4.     In my PL/SQL proceedure I am using following code to execute the command
    v_Return := OSCommand_Run('/abc/xyz/search.sh');
    to execute the shell script.
    Proceedure executes without any error and generates a new csv file with report data , however shell script does not get executed and hence all csv files created earlier remain as it is in the folder.
    Please help.

    Sven W. wrote:
    What happens if you remove the catch exception block from your java command?
    I asume you still might have a permission issue. But it could be hidden from you, because of the exception is catched and printed into nirvana.Executed the wrapper function OSCOMMAND_RUN as below
    DECLARE
    v_Return VARCHAR2(2000);
    BEGIN
    v_Return := OSCOMMAND_RUN('/recon/html/invoice/search.sh' );
    DBMS_OUTPUT.PUT_LINE('v_Return = ' || v_Return);
    END;
    And following is the result
    v_Return = 0
    Process exited.
    In case of exception it would had printed the exception.
    One more thing I noticed, even though I have taken following permissions
    GRANT     RECON     SYS     java.io.FilePermission     /abc/*     execute     ENABLED     347
    GRANT     RECON     SYS     java.io.FilePermission     /abc/xyz/*     execute     ENABLED     351
    GRANT     RECON     SYS     java.io.FilePermission     <<ALL FILES>>      execute     ENABLED     352
    GRANT     RECON     SYS     java.lang.RuntimePermission     readFileDescriptor     *     ENABLED     350
    GRANT     RECON     SYS     java.lang.RuntimePermission     writeFileDescriptor     *     ENABLED     349
    When I create a new search.sh in /abc dir I get following error
    v_Return = the Permission (java.io.FilePermission /abc/search.sh execute) has not been granted to RECON. The PL/SQL to grant this is dbms_java.grant_permission( 'RECON', 'SYS:java.io.FilePermission', '/abc/search.sh', 'execute' )
    Edited by: 960702 on Sep 25, 2012 10:34 AM

  • Call Script through plug-in.

    Hello,
    I have written script(.jsx).I want to execute that script throught photoshop CS3 plugin(Like indesign we call script through plugin).Is it possible call script through Plugin?
    if possible then how?
    On the following thread
    http://forums.adobe.com/message/4632125#4632125
    some one said we can call script by using executeScript method in CS5.But executeScript method is not present in CS3.
    So,I tryied following for CS6.
         #include "JSScriptingSuite.h"
         JSScriptingSuit2 sScriptingSuite;
         sScriptingSuite.CreateEngine(&engineRef);         
         if(engineRef != NULL)
              char *scriptText = "documents.add();"; // script to create new doc.         
              ASUnicode script = (ASUnicode)scriptText;
              sScriptingSuite.ExecuteScript(engineRef, &script, kJSExecutionModeNoDebug, kSPNoError);
        But, when i call CreateEngine function it crashes.Is anything wrong in above code?which library i have to add?
          please,help me.

    The following runJavascript() function lets you execute JavaScript code in Photoshop CS1 to CS6 and Photoshop Elements 6 to 11.  Its only parameter is a c string containing the Javascript code. If the execution was successfull it returns true, otherwise false. If there is an error in the JavaScript code, it displays an error message with the details.
    #include "JSScriptingSuite.h"
    BOOL runJavascript(const char * jscode)
            ASErr err = 0;
            JSScriptingSuite2 * sScriptingSuite = NULL;
            err = sSPBasic->AcquireSuite( kJSScriptingSuite, kJSScriptingSuiteVersion2, (const void**)&sScriptingSuite);
            if (sScriptingSuite == NULL)  //Also support Photoshop CS1-CS4 and Elements 6-10
                    err = sSPBasic->AcquireSuite( kJSScriptingSuite, kJSScriptingSuiteVersion1, (const void**)&sScriptingSuite);
            if  (sScriptingSuite == NULL) return false;
            JSEngineRef engineRef = NULL;
            err = sScriptingSuite->CreateEngine( &engineRef );
            if ( err == kSPNoError )
                    //Convert ascii to unicode
                    wchar_t  * wcode;
                    size_t codelength = strlen(jscode)+1;
                    wcode = (wchar_t *)malloc(codelength*sizeof(wchar_t));
                    mbstowcs(wcode, jscode, codelength);
                    const ASUnicode * result = NULL;
                    err = sScriptingSuite->ExecuteScript( engineRef, (ASUnicode *) wcode, kJSExecutionModeNoDebug, &result );
                    if ( err != kSPNoError )
                            //Display error details
                            MessageBoxW(hDialog,(LPCWSTR)result,L"JavaScript Error",0);
                            return false;
                    free(wcode);
           else
                   return false;
            if (engineRef) sScriptingSuite->DeleteEngine( engineRef );
            return true;

  • Running a Unix Script through a Java Program

    Hi !!!!!!!!! Can anybody plz suggest me an approach for the following queries -
    1.  How to execute a unix script through a java program ?
      2.  How to send the o/p of the script to a java program so that it can be used .

    import java.io.*;
    public RunScript
       public static void main(String args[])
          try
              Process p = Runtime.getRuntime().exec("script.sh");
              BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));     
              while ((line = input.readLine()) != null)
                 System.out.println(line);
              input.close();
          catch(Exception e)
              e.printStackTrace();

  • Error to execute the script through command prompt

    I tried to execute the script through command prompt. I got some following error. Could you please advice me how to rectify this.
    cscript D:\JS\Test.js
    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
    D:\JS\Test.js(1, 1) Microsoft JScript runtime error: 'app' is undefined.
    Thanks,
    Prabudass

    I haven't use CS for quite some time and file associations may not work with the command prompt.
    You can try using Windows Explorer to browse to a .js file then right click on that file. From the popup menu choose Open With. Even if you see Photoshop in the file list choose Browse at the bottom. Browse to Photoshop and make sure to check 'Always use selected program...'
    If that doesn't work you will need to create an action that runs your script and make a droplet from that action. You can then use the droplet in the command prompt. You may also need to create a 'dummy' image file to launch the droplet with if you script doesn't require an open document at startup. See http://www.ps-scripts.com/bb/viewtopic.php?t=967

  • I have made .indd file with some form fields in it, now haw to read these fields and manipulate its content through script in indesign

    I have made .indd file with some form fields in it, now haw to read these fields and manipulate its content through script in indesign

    It's probably best to ask in the InDesign Scripting forum:
    InDesign Scripting

  • Can you set a layer to "Template" through script?

    Hi there,
         I am creating a script to batch export multiple artboards as SVG, and setting a layer to "Template" will keep my unwanted paths from exporting. I am using Illustrator version 17.1.9(64bit)
    Is there a way to set a layer to "template" through script?
    Thanks!
    Scott

    You are correct on this, if I create a template Action let say called "template layer" I can call that with app.doScript("template layer", "folder"). After testing it does work... on my client where I have the Action, but I have a few other artist who will need to run this script.
    EXAMPLE:
    for (var i = 0; i < app.activeDocument.layers.length; i++)
        app.activeDocument.activeLayer = app.activeDocument.layers[i] ;        
        if(app.activeDocument.layers[i].visible == false){
            app.doScript ("template layer", "NI");
    The only other solution I can think of is putting all non-exportable objects on a layer, and call that layer "nonExport" and select all objects on this layer delete them, then export, then undo this action ... ewwww... sounds messy.
    Cheers,
    Scott

  • Is there way to export a selection to JPEG through script (CS3)

    Hi all,
    Is there way to export a selection to JPEG through script (CS3).
    CS2 has possible method to export a selection to JPEG using the method
    Application.JPEGExportPreferences.ExportingSelection = True. But this method is not supported in CS3.
    Regards,
    Hemi

    Hi Hem,
    http://forums.adobe.com/thread/424774?tstart=30
    regards,
    sudar

  • Hide navigation pane of adobe reader through scripting

    Hi.. I'm looking for a script to hide the navigation pane of the adobe reader through scripting, is there any way I can achieve that?
    my main objective is to restrict user from attaching a file by using navigation pane because I'm already giving buttons to attach a file on the pdf and I want user to attach a file ONLY using buttons on the pdf. Can I achieve this by any other way?
    Thanks in advance.
    Sunaif

    Hi,
    you can hide all panes with this script in the docReady:event.
         event.target.viewState = {overViewMode:1};
    More examples:
    http://thelivecycle.blogspot.com/2010/04/xfa-form-control-view-settings.html

  • Change font type through scripting support.

    Please help me for this scripting support. . I have 100 of PSD with text. Text is brush script. I need to change font as some other font through scripting.

    With the Mail App you cannot change the font.

  • Running Shell scripts through JAva

    Hi,
    I tried to execute a Shell script through a Java program.
    The code I used is as below:
    import java.lang.*;
    import java.io.*;
    public class sys {
    public static void main(String[] args) {
    Runtime rt = Runtime.getRuntime();
    String[] callAndArgs = { "chgpasswd" };
    try {
    Process child = rt.exec(callAndArgs);
    child.waitFor();
    System.out.println("Process exit code is: " + child.exitValue());
    catch(IOException e) {
    System.err.println( "IOException starting process!");
    catch(InterruptedException e) {
    System.err.println( "Interrupted waiting for process!");
    The "chgpasswd" shell script calls the "passwd" command of Unix.
    It threw out an IO exception.
    Then I gave the parameter as "./chgpasswd". It now gave an exit value of 255.
    The "chgpasswd" script exists in the same directory as the .class file.
    I checkd up the exit code reference...it says exit value of 255 could mean as exit code out of range........an exit code > 255....which unfortunately has no documentation, I guess.
    Can you help ?

    This is on a Unix platform, correct? Assuming so...
    If I remember correctly, exit codes can be greater than 255. To get the real exit code equates to something like: exitcode & 512 to obtain the real exit code.
    Make sure "chgpasswd" shell script has the execute permissions set. Additionally, make sure that the first line of the script (the magic line) has the appropriate shell/interpreter to execute specified. For example, if "chgpasswd" were a Bourne (sh) script, the first like would be:
    #!/bin/shFor perl, it may be something like:
    #!/usr/bin/perlIt needs to be the absolute path to the shell/interpreter is the point.

  • How to load the Employee Images through Script

    Dear All,
    How to load Employee Images into HRMS module through script, Pls provide scripts any body having..
    Thank in advance,
    Hanimi
    Edited by: Hanimi on Jun 7, 2011 10:12 AM

    Hi Hussain,
    Following ctl file is working fine for loading images, But problem is at a time it is loading only 64 rows, pls let me know what i have change in my ctl file for loading all data at a time..
    load data
    infile '/usr/tmp/Images_Data.dat'
    INTO TABLE PER_IMAGES
    append
    FIELDS TERMINATED BY ','
    TRAILING NULLCOLS(
    parent_id,
    table_name constant "PER_PEOPLE_F",
    ext_fname FILLER CHAR(80),
    "IMAGE" LOBFILE(ext_fname) TERMINATED BY EOF,i
    mage_id "PER_IMAGES_S.nextval"
    Thanks,
    Hanimi..

  • How to find out web content files linked in folio through scripting

    Hi all,
    Please suggest me, how to find out web content files linked in folio through scripting.
    Regards,
    Moorthy

    @Moorthy – can you tell us a bit more? By mentioning "folio", I think you are referring to Adobe Digitial Publishing Suite (ADPS or short: DPS). If yes:
    1. Do you want to analyze Folio files *.folio and get the linked web content files?
    2. Or do you want to check an InDesign file with an overlay and check what files are linked as web content?
    3. Or something else?
    Where is your base problem?
    Packaging the InDesign files and copy/relinking the web content files after the packaging process?
    Uwe

  • Exceuting SQL Script through java

    Hi All
    I am making an installer for my application. How do i execute a SQL script through java. Its a sepeate file that has the SQL script for DB creation.
    Regards
    Abhinav

    If you database support ";" to separate sqll, then you can use Statement.execute(sql); to run all SQLscipt once, otherwise you need to load all sqls into Vector, then reun sql step by step. Copy some code for instance:
    public final static Object[] getSQLStatements(String sqlFile) throws java.
    io.IOException {
    java.util.Vector v = new java.util.Vector(1000);
    try {
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.
    FileReader(sqlFile));
    java.util.Vector batchs = new java.util.Vector(10);
    String temp;
    while ( (temp = br.readLine()) != null) {
    temp = temp.trim();
    if (temp.length() == 0)
    continue;
    switch (temp.charAt(0)) {
    case '*':
    case '"':
    case '\'':
    // System.out.println(temp);
    break; //Ignore any line which begin with the above character
    case '#': //Used to begin a new sql statement
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    break;
    case 'S':
    case 's':
    case '?':
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    v.addElement(temp);
    break;
    default:
    batchs.addElement(temp);
    break;
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    br.close();
    br = null;
    catch (java.io.FileNotFoundException fnfe) {
    v.addElement(sqlFile); //sqlFile is a sql command, not a file Name
    Object[] statements = new Object[v.size()];
    for (int i = 0; i < v.size(); i++)
    statements[i] = v.elementAt(i);
    return statements;
    for (int i = 0; i < statements.length; i++) {
    if (statements[i] instanceof java.lang.String) {
    String temp = (java.lang.String) statements;
    switch (temp.charAt(0)) {
    case 'S':
    case 's':
    case '?':
    System.out.println(temp);
    rs = stmt.executeQuery(temp);
    ResultSetMetaData resultSetMetaData = rs.
    getMetaData();
    int iNumCols = resultSetMetaData.getColumnCount();
    for (int j = 1; j <= iNumCols; j++) {
    System.out.println(resultSetMetaData.getColumnLabel(j)
    + " " + resultSetMetaData.getColumnTypeName(j)
    + " " + resultSetMetaData.getColumnType(j)
    + " " + resultSetMetaData.getPrecision(j)
    + " " + resultSetMetaData.getScale(j)
    Object colval;
    long ncount = 0;
    while (rs.next()) {
    // System.out.print(rs.rowDeleted()+" ");
    ncount++;
    for (int j = 1; j <= iNumCols; j++) {
    colval = rs.getObject(j);
    System.out.print(colval + " ");
    System.out.println();
    rs.close(); //Let the CONCUR_UPDATABLE resultSet release its open files at once.
    rs = null;
    System.out.println(
    "The total row number of resultset: " + ncount);
    System.out.println();
    break;
    default:
    int updateCount = stmt.executeUpdate(temp);
    System.out.println(temp + " : " + updateCount);
    System.out.println();
    else if (statements[i] instanceof java.lang.Object[]) {
    int[] updateCounts;
    Object[] temp = (java.lang.Object[]) statements[i];
    try {
    for (int j = 0; j < temp.length; j++){
    System.out.println( temp[j]);
    stmt.addBatch( (java.lang.String) temp[j]);
    updateCounts = stmt.executeBatch();
    for (int j = 0; j < temp.length; j++)
    System.out.println((j+1)+":"+temp[j]);
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":" +updateCounts[j]);
    catch (java.sql.BatchUpdateException e) {
    updateCounts = e.getUpdateCounts();
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":"+updateCounts[j]);
    java.sql.SQLException sqle = e;
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    catch (java.sql.SQLException sqle) {
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    stmt.clearBatch();
    System.out.println();

Maybe you are looking for