<?xml version="1.0" encoding="iso-8859-1"?>

<spooler>

    <config>

        <jobs>

          <!-- Please, adjust parameters for host, authentication and command for remote execution -->
          <job name  = "scheduler_ssh_execution"
               title = "Launch remote executable file by ssh">

            <description>
              <include file = "jobs/JobSchedulerSSHJob.xml"/>
            </description>

            <params>
              <!-- please, adjust the settings for remote host and user -->
              <param name = "host"              value = "localhost"/>
              <param name = "user"              value = "anonymous"/>
              <!-- please, adjust the settings for your private key file and the passphrase by which it is possibly protected -->
              <param name = "auth_file"         value = "./config/my_private_key.dsa"/>
              <param name = "password"          value = ""/>
              <!-- the specified authentication method must be supported by the remote ssh server -->
              <param name = "auth_method"       value = "publickey"/>
              <!-- a simple example for a remote command on unix servers would be: -->
              <!-- (keep in mind that commands executed in separate sessions are separated with %%) -->
              <param name = "command"           value = "uname %% echo hallo"/>
              <!-- a more complex example for remote commands on unix servers would be: -->
              <!-- (have a thorough look at the use of &quot; &amp; &gt; &lt; used for xml compliance) -->
              <!--
              <param name = "command"           value = "
                if [ ! -d test_dir ];
                  then mkdir test_dir;
                fi
    %%
    if [ ! -w test_dir/test_file ]; 
      then echo &quot;0 `date &quot;+%Y-%m-%d_%H:%M:%S&quot;`&quot; &gt; test_dir/test_file;
    fi
    %%
    tail -1  test_dir/test_file | 
    awk 'BEGIN {&quot;date +%Y-%m-%d_%H:%M:%S&quot; | 
    getline curr_date;close(&quot;date&quot;); }
    END{ print $1+1,curr_date;}' &gt;&gt; test_dir/test_file &amp;&amp; 
    cp test_dir/test_file test_dir/test_file_$$ 
    %%
    tar cvf test_file.tar test_dir/test_file* 2&gt;&amp;1 /dev/null &amp;&amp; mv test_file.tar test_dir
                "/>
                -->
            </params>

            <script language   = "java" 
                    java_class = "sos.stacks.ganymed.JobSchedulerSSHJob"/>
    
          </job>
    

          <!-- Please, adjust parameters for host, authentication and command for remote execution -->
          <job name  = "scheduler_ssh_execution_service"
               title = "Launch remote executable file by ssh"
               order = "yes">

            <description>
              <include file = "jobs/JobSchedulerSSHJob.xml"/>
            </description>

            <params>
              <!-- You could set default parameters for orders that are executed by this job -->
              <!-- More specific parameters could be provided by order parameters -->
              <param name = "host"  value = "localhost"/>
            </params>
    
            <script language   = "java" 
                    java_class = "sos.stacks.ganymed.JobSchedulerSSHJob"/>
    
          </job>
    

          <!-- Please, adjust parameters for host, authentication and files for secure copy -->
          <job name  = "scheduler_scp_send"
               title = "Send files by SCP">

            <description>
              <include file = "jobs/JobSchedulerSCPJob.xml"/>
            </description>

            <params>
              <!-- "get" and "put" specify the direction for the file transfer -->
              <param name = "action"            value = "put"/>
              <!-- please, adjust the settings for remote host and user -->
              <param name = "host"              value = "localhost"/>
              <param name = "user"              value = "anonymous"/>
              <!-- please, adjust the settings for your private key file and the passphrase by which it is possibly protected -->
              <param name = "auth_file"         value = "./config/my_private_key.dsa"/>
              <param name = "password"          value = ""/>
              <!-- a regular expression specifies the files to be transferred -->
              <param name = "file_spec"         value = "^(.*)$"/>
              <param name = "local_dir"         value = "/tmp"/>
              <param name = "remote_dir"        value = "/tmp"/>
            </params>
    
            <script language   = "java" 
                    java_class = "sos.stacks.ganymed.JobSchedulerSCPJob"/>
    
          </job>


          <!-- Please, adjust parameters for host, authentication and files for secure copy -->
          <job name  = "scheduler_scp_receive"
               title = "Receive files by SCP">

            <description>
              <include file = "jobs/JobSchedulerSCPJob.xml"/>
            </description>

            <params>
              <!-- "get" and "put" specify the direction for the file transfer -->
              <param name = "action"            value = "get"/>
              <!-- please, adjust the settings for remote host and user -->
              <param name = "host"              value = "localhost"/>
              <param name = "user"              value = "anonymous"/>
              <!-- please, adjust the settings for your private key file and the passphrase by which it is possibly protected -->
              <param name = "auth_file"         value = "./config/my_private_key.dsa"/>
              <param name = "password"          value = ""/>
              <!-- instead of a file specification you could give a list of files to be transferred -->
              <param name = "file_list"         value = "1a.csv;1b.csv;1c.csv"/>
              <param name = "local_dir"         value = "/tmp"/>
              <param name = "remote_dir"        value = "/tmp"/>
              <!-- create non-existing directories -->
              <param name = "create_dir"        value = "true"/>
            </params>
    
            <script language   = "java" 
                    java_class = "sos.stacks.ganymed.JobSchedulerSCPJob"/>
    
          </job>


          <!-- Please, adjust parameters for host, authentication and files for secure file transfer -->
          <job name  = "scheduler_sftp_send"
               title = "Send files by SFTP">

            <description>
              <include file = "jobs/JobSchedulerSFTPSendJob.xml"/>
            </description>

            <params>
              <!-- please, adjust the settings for remote host and user -->
              <param name = "host"              value = "localhost"/>
              <param name = "user"              value = "anonymous"/>
              <!-- please, adjust the settings for your private key file and the passphrase by which it is possibly protected -->
              <param name = "auth_file"         value = "./config/my_private_key.dsa"/>
              <param name = "password"          value = ""/>
              <!-- select all files except for file names ending with ~ -->
              <param name = "file_spec"         value = "[^~]$"/>
              <param name = "local_dir"         value = "/tmp"/>
              <param name = "remote_dir"        value = "/tmp"/>
              <!-- recurse subdirectories -->
              <param name = "recursive"         value = "true"/>
              <!-- send files with this suffix and rename them after transfer to make them appear atomically -->
              <param name = "atomic_suffix"     value = "~"/>
            </params>
    
            <script language   = "java" 
                    java_class = "sos.stacks.ganymed.JobSchedulerSFTPSendJob"/>
    
          </job>
    

          <!-- Please, adjust parameters for host, authentication and files for secure file transfer -->
          <job name  = "scheduler_sftp_receive"
               title = "Receive files by SFTP">

            <description>
              <include file = "jobs/JobSchedulerSFTPReceiveJob.xml"/>
            </description>

            <params>
              <!-- please, adjust the settings for remote host and user -->
              <param name = "host"              value = "wilma"/>
              <param name = "user"              value = "test"/>
              <!-- please, adjust the settings for your private key file and the passphrase by which it is possibly protected -->
              <param name = "auth_file"         value = "./config/my_private_key.dsa"/>
              <param name = "password"          value = ""/>
              <!-- select all files -->
              <param name = "file_spec"         value = "^(.*)$"/>
              <param name = "local_dir"         value = "/tmp"/>
              <param name = "remote_dir"        value = "/tmp"/>
              <!-- send files with this suffix and rename them after transfer to make them appear atomically -->
              <param name = "atomic_suffix"     value = "~"/>
            </params>
    
            <script language   = "java" 
                    java_class = "sos.stacks.ganymed.JobSchedulerSFTPReceiveJob"/>
    
          </job>
    
        </jobs>


        <job_chains>

          <job_chain name                = "scheduler_ssh_execution_service" 
                     orders_recoverable  = "yes"
                     visible             = "yes">

            <job_chain_node state = "start"
                              job = "scheduler_ssh_execution_service"
                       next_state = "success"
                      error_state = "error"/>
            <job_chain_node state = "success"/>
            <job_chain_node state = "error"/>

          </job_chain>

        </job_chains>


    </config>

</spooler>