Sponsored Content
Top Forums Shell Programming and Scripting Using columns from 2 files and extracting string Post 302566188 by radoulov on Wednesday 19th of October 2011 05:46:18 PM
Old 10-19-2011
If A is at position 1235, D is at position1238, not at 1237, or I'm missing something?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extracting columns from different files for later merging

Hello! I wan't to extract columns from two files and later combine them for plotting with gnuplot. If the files file1 and file2 look like: fiile1: a, 0.62,x b, 0.61,x file2: a, 0.43,x b, 0,49,x The desired output is a 0.62 0.62 b 0.61 0.49 Thank you in advance! (2 Replies)
Discussion started by: kingkong
2 Replies

2. Shell Programming and Scripting

Extracting a string from one file and searching the same string in other files

Hi, Need to extract a string from one file and search the same in other files. Ex: I have file1 of hundred lines with no delimiters not even space. I have 3 more files. I should get 1 to 10 characters say substring from each line of file1 and search that string in rest of the files and get... (1 Reply)
Discussion started by: mohancrr
1 Replies

3. Shell Programming and Scripting

Append string to columns from 2 files

Hi Having a file as follows file1.txt Date (dd/mm)Time Server IP Error Code =========================================================================== 10/04/2008 10:10 ServerA xxx.xxx.xxx.xxx 6 10/04/2008 10:10 ServerB ... (3 Replies)
Discussion started by: karthikn7974
3 Replies

4. Shell Programming and Scripting

extracting columns from 2 files

Hello, I have 2 files file1 & file2 = a1 b1 a2 b2 a3 b3 ... = c1 d1 c2 d2 c3 d3 ... I need to compare if b(i)=c(j) . i,j=1,2,3,4,... If yes, right a(i) d(j) in output file3 per line (1 Reply)
Discussion started by: newpromo
1 Replies

5. UNIX for Dummies Questions & Answers

Extracting columns from multiple files with awk

hi everyone! I already posted it in scripts, I'm sorry, it's doubled I'd like to extract a single column from 5 different files and put them together in an output file. I saw a similar question for 2 input files, and the line of code workd very well, the code is: awk 'NR==FNR{a=$2; next}... (1 Reply)
Discussion started by: orcaja
1 Replies

6. Shell Programming and Scripting

Extracting columns from multiple files with awk

hi everyone! I'd like to extract a single column from 5 different files and put them together in an output file. I saw a similar question for 2 input files, and the line of code workd very well, the code is: awk 'NR==FNR{a=$2; next} {print a, $2}' file1 file2 I added the file3, file4 and... (10 Replies)
Discussion started by: orcaja
10 Replies

7. Shell Programming and Scripting

extracting columns falling within specific ranges for multiple files

Hi, I need to create weekly files from daily records stored in individual monthly filenames from 1999-2010. my sample file structure is like the ones below: daily record stored per month: 199901.xyz, 199902.xyz, 199903.xyz, 199904.xyz ...199912.xyz records inside 199901.xyz (original data... (4 Replies)
Discussion started by: ida1215
4 Replies

8. Shell Programming and Scripting

Compare columns of multiple files and print those unique string from File1 in an output file.

Hi, I have multiple files that each contain one column of strings: File1: 123abc 456def 789ghi File2: 123abc 456def 891jkl File3: 234mno 123abc 456def In total I have 25 of these type of file. (5 Replies)
Discussion started by: owwow14
5 Replies

9. Shell Programming and Scripting

Extracting data from specific rows and columns from multiple csv files

I have a series of csv files in the following format eg file1 Experiment Name,XYZ_07/28/15, Specimen Name,Specimen_001, Tube Name, Control, Record Date,7/28/2015 14:50, $OP,XYZYZ, GUID,abc, Population,#Events,%Parent All Events,10500, P1,10071,95.9 Early Apoptosis,1113,11.1 Late... (6 Replies)
Discussion started by: pawannoel
6 Replies

10. Shell Programming and Scripting

Joining files using awk not extracting all columns from File 2

Hello All I'm joining two files using Awk by Left outer join on the file 1 File 1 1 AA 2 BB 3 CC 4 DD File 2 1 IND 100 200 300 2 AUS 400 500 600 5 USA 700 800 900 (18 Replies)
Discussion started by: venkat_reddy
18 Replies
STRIGGER(1)							 Slurm components						       STRIGGER(1)

NAME
strigger - Used set, get or clear Slurm trigger information. SYNOPSIS
strigger --set [OPTIONS...] strigger --get [OPTIONS...] strigger --clear [OPTIONS...] DESCRIPTION
strigger is used to set, get or clear Slurm trigger information. Triggers include events such as a node failing, a job reaching its time limit or a job terminating. These events can cause actions such as the execution of an arbitrary script. Typical uses include notifying system administrators of node failures and gracefully terminating a job when it's time limit is approaching. A hostlist expression for the nodelist or job ID is passed as an argument to the program. Trigger events are not processed instantly, but a check is performed for trigger events on a periodic basis (currently every 15 seconds). Any trigger events which occur within that interval will be compared against the trigger programs set at the end of the time interval. The trigger program will be executed once for any event occuring in that interval. The record of those events (e.g. nodes which went DOWN in the previous 15 seconds) will then be cleared. The trigger program must set a new trigger before the end of the next interval to insure that no trigger events are missed. If desired, multiple trigger programs can be set for the same event. IMPORTANT NOTE: This command can only set triggers if run by the user SlurmUser unless SlurmUser is configured as user root. This is required for the slurmctld daemon to set the appropriate user and group IDs for the executed program. Also note that the program is exe- cuted on the same node that the slurmctld daemon uses rather than some allocated compute node. To check the value of SlurmUser, run the command: scontrol show config | grep SlurmUser ARGUMENTS
-a, --primary_slurmctld_failure Trigger an event when the primary slurmctld fails. -A, --primary_slurmctld_resumed_operation Trigger an event when the primary slurmctld resuming operation after failure. -b, --primary_slurmctld_resumed_control Trigger an event when primary slurmctld resumes control. --block_err Trigger an event when a BlueGene block enters an ERROR state. -B, --backup_slurmctld_failure Trigger an event when the backup slurmctld fails. -c, --backup_slurmctld_resumed_operation Trigger an event when the backup slurmctld resumes operation after failure. -C, --backup_slurmctld_assumed_control Trigger event when backup slurmctld assumes control. --clear Clear or delete a previously defined event trigger. The --id, --jobid or --userid option must be specified to identify the trig- ger(s) to be cleared. -d, --down Trigger an event if the specified node goes into a DOWN state. -D, --drained Trigger an event if the specified node goes into a DRAINED state. -e, --primary_slurmctld_acct_buffer_full Trigger an event when primary slurmctld accounting buffer is full. -F, --fail Trigger an event if the specified node goes into a FAILING state. -f, --fini Trigger an event when the specified job completes execution. --front_end Trigger events based upon changes in state of front end nodes rather than compute nodes. Applies to BlueGene and Cray architectures only, where the slurmd daemon executes on front end nodes rather than the compute nodes. Use this option with either the --up or --down option. -g, --primary_slurmdbd_failure Trigger an event when the primary slurmdbd fails. -G, --primary_slurmdbd_resumed_operation Trigger an event when the primary slurmdbd resumes operation after failure. --get Show registered event triggers. Options can be used for filtering purposes. -h, --primary_database_failure Trigger an event when the primary database fails. -H, --primary_database_resumed_operation Trigger an event when the primary database resumes operation after failure. -i, --id=id Trigger ID number. -I, --idle Trigger an event if the specified node remains in an IDLE state for at least the time period specified by the --offset option. This can be useful to hibernate a node that remains idle, thus reducing power consumption. -j, --jobid=id Job ID of interest. NOTE: The --jobid option can not be used in conjunction with the --node option. When the --jobid option is used in conjunction with the --up or --down option, all nodes allocated to that job will considered the nodes used as a trigger event. -n, --node[=host] Host name(s) of interest. By default, all nodes associated with the job (if --jobid is specified) or on the system are considered for event triggers. NOTE: The --node option can not be used in conjunction with the --jobid option. When the --jobid option is used in conjunction with the --up, --down or --drained option, all nodes allocated to that job will considered the nodes used as a trig- ger event. -M, --clusters=<string> Clusters to issue commands to. -o, --offset=seconds The specified action should follow the event by this time interval. Specify a negative value if action should preceded the event. The default value is zero if no --offset option is specified. The resolution of this time is about 20 seconds, so to execute a script not less than five minutes prior to a job reaching its time limit, specify --offset=320 (5 minutes plus 20 seconds). -p, --program=path Execute the program at the specified fully qualified pathname when the event occurs. The program will be executed as the user who sets the trigger. If the program fails to terminate within 5 minutes, it will be killed along with any spawned processes. -Q, --quiet Do not report non-fatal errors. This can be useful to clear triggers which may have already been purged. -r, --reconfig Trigger an event when the system configuration changes. --set Register an event trigger based upon the supplied options. NOTE: An event is only triggered once. A new event trigger must be set established for future events of the same type to be processed. -t, --time Trigger an event when the specified job's time limit is reached. This must be used in conjunction with the --jobid option. -u, --up Trigger an event if the specified node is returned to service from a DOWN state. --user=user_name_or_id Clear or get triggers associated with the specified user. Specify either a user name or user ID. -v, --verbose Print detailed event logging. This includes time-stamps on data structures, record counts, etc. -V , --version Print version information and exit. OUTPUT FIELD DESCRIPTIONS
TRIG_ID Trigger ID number. RES_TYPE Resource type: job or node RES_ID Resource ID: job ID or host names or "*" for any host TYPE Trigger type: time or fini (for jobs only), down or up (for jobs or nodes), or drained, idle or reconfig (for nodes only) OFFSET Time offset in seconds. Negative numbers indicated the action should occur before the event (if possible) USER Name of the user requesting the action PROGRAM Pathname of the program to execute when the event occurs EXAMPLES
Execute the program "/usr/sbin/primary_slurmctld_failure" whenever the primary slurmctld fails. > cat /usr/sbin/primary_slurmctld_failure #!/bin/bash # Submit trigger for next primary slurmctld failure event strigger --set --primary_slurmctld_failure --program=/usr/sbin/primary_slurmctld_failure # Notify the administrator of the failure using by e-mail /usr/bin/mail slurm_admin@site.com -s Primary_SLURMCTLD_FAILURE > strigger --set --primary_slurmctld_failure --program=/usr/sbin/primary_slurmctld_failure Execute the program "/usr/sbin/slurm_admin_notify" whenever any node in the cluster goes down. The subject line will include the node names which have entered the down state (passed as an argument to the script by SLURM). > cat /usr/sbin/slurm_admin_notify #!/bin/bash # Submit trigger for next event strigger --set --node --down --program=/usr/sbin/slurm_admin_notify # Notify administrator using by e-mail /usr/bin/mail slurm_admin@site.com -s NodesDown:$* > strigger --set --node --down --program=/usr/sbin/slurm_admin_notify Execute the program "/usr/sbin/slurm_suspend_node" whenever any node in the cluster remains in the idle state for at least 600 seconds. > strigger --set --node --idle --offset=600 --program=/usr/sbin/slurm_suspend_node Execute the program "/home/joe/clean_up" when job 1234 is within 10 minutes of reaching its time limit. > strigger --set --jobid=1234 --time --offset=-600 --program=/home/joe/clean_up Execute the program "/home/joe/node_died" when any node allocated to job 1234 enters the DOWN state. > strigger --set --jobid=1234 --down --program=/home/joe/node_died Show all triggers associated with job 1235. > strigger --get --jobid=1235 TRIG_ID RES_TYPE RES_ID TYPE OFFSET USER PROGRAM 123 job 1235 time -600 joe /home/bob/clean_up 125 job 1235 down 0 joe /home/bob/node_died Delete event trigger 125. > strigger --clear --id=125 Execute /home/joe/job_fini upon completion of job 1237. > strigger --set --jobid=1237 --fini --program=/home/joe/job_fini COPYING
Copyright (C) 2007 The Regents of the University of California. Copyright (C) 2008-2010 Lawrence Livermore National Security. Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). CODE-OCEC-09-009. All rights reserved. This file is part of SLURM, a resource management program. For details, see <http://www.schedmd.com/slurmdocs/>. SLURM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SLURM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. SEE ALSO
scontrol(1), sinfo(1), squeue(1) strigger 2.3 December 2010 STRIGGER(1)
All times are GMT -4. The time now is 08:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy