Apologies, as i have not tried this earlier.
Hi,
I need to create oozie workflow that exeuctes a shell script. The shell script has curl command which downloads a specific file from client's repo.
As commands in shell scripts are only able to recognize hdfs directories, how could i execute the script.?
Lets say below is the Sample code:
curl -o ~/test.jar http://central.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
hdfs dfs -copyFromLocal ~/test.jar /user/sr/test2
How can i execute the script with above two commands using oozie.?
I found the answer...
data=curl http://central.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.csv
echo "$data" | hdfs dfs -appendToFile - /path/to/hdfs/directory/PPP.csv
Related
I have to run this command
./emsInventory.sh -s 10 -i EMS1004 -p EMS -v 10.2.0.15.1 -d "EMS Patch " -c ems10/pass_ems10#rac_ems10.agnity.com
In robot framework to make sure that data is created or not
Use the Run Process in the Process library - this is its precise purpose.
You can use SSH Library in robot framework more details can be found here http://robotframework.org/SSHLibrary/SSHLibrary.html.
Below examples could be useful
Execute Command And Verify Return Code
[Documentation] Often getting the return code of the command is enough.
... This behaviour can be adjusted as Execute Command arguments.
${rc}= Execute Command echo Success guaranteed. return_stdout=False return_rc=True
Should Be Equal ${rc} ${0}
Executing Commands In An Interactive Session
[Documentation] Execute Command always executes the command in a new shell.
... This means that changes to the environment are not persisted
... between subsequent Execute Command keyword calls.
... Write and Read Until variants can be used to operate in the same shell.
Write cd ..
Write echo Hello from the parent directory!
${output}= Read Until directory!
Should End With ${output} Hello from the parent directory!
How exactly can I send data to telegraf from windows command prompt / git bash?
I'm trying to send data in unix bash to telegraf.
In bash I do:
echo -e "my_db,owner=me,field=value" | nc -u4 -w1 my.telefra.host.com 1231;
You can use telegraf exec input plugin.
It allows you to execute any sort of command, including powershell, cmd, git bash etc. For instance, if I want to run powershell command,
commands = ["powershell -command <command>"]
Same can be done for git bash,
commands = ["<path>\bash.exe <command>"]
I am trying to run a Unix script which populates our Aged Debt table for our finance department from SSIS but cannot get my head around it. The script has to be run under user "username" and the script to run is :
P1='0*99999999' P2='2015_03_25*%%YY*Y' P3='Y*0.0' P4='Y*0.0' P5='Y*0.0' P6='Y*0.0' P7='Y*0.0' P8='Y*0.0' /cer_cerprod1/exe/par50219r
I believe that I need to have ssh configured on both sides to do this and I believe that I may do this from the "Execute Process Task" but I don't think that I am populating the parameters correctly.
Can anyone help.
I currently do this using putty/plink. Like sorrell says above, You use an execute process task to call a batch file. That batch file calls plink. I pass plink the shell script on the unix server that I want it to execute.
example of batch file:
echo y | "d:\program files\putty\plink.exe" [username#yourserver.com] -pw [password] -v sh /myremotescriptname.sh
the echo y at the beginning is to tell plink to accept the security credentials of the server.
I am using Putty plink command line utility to run a few scripts on my UNIX server. I use the -m option as:
plink -ssh -pw xxx myserver –m file.txt
The file file.txt contains a list of commands that are to be executed and is generated dynamically using some application program. Some of the commands in file.txt can run for hours, which will make the user wait for a long time. Moreover, I am interested in execution of the first line of each of the scripts.
So I want to make sure that a control+c command is sent just after the script is run so that complete script is not run. So instead of using the following in my file.txt:
script1
script2
script3
I want to use:
script1
control+C command
script2
control+C command
script3
control+C command
Can anyone help me in writing this control+c in my file.txt?
Thanks a lot
i am trying to remotely execute a perl script that takes data from stdin, over ssh.
The tricky part is that i don't want to upload the script itself to the remote server.
The data that the remote script will read from stdin is produced by another perl script run locally.
Let's assume the following:
my local script producing data is called cron_extract_section.pl
my local script that will be run remotely is called cron_update_section.pl
both scripts take one argument on the command line, a simple word
I manage to execute the script remotely, if the script is present on the remote machine:
./cron_extract_section.pl ${SECTION} 2> /dev/null | ssh user#remote ~/path/to/remote/script/cron_update_section.pl ${SECTION}
I know also that i can run a script on a remote server without having to upload it first, using the following syntax:
ssh user#remote "perl - ${SECTION}" < ./cron_update_section.pl
What i can't figure out is how to feed the local script cron_update_section.pl over ssh to perl, AND also pipe the result of the local script cron_extract_section.pl to perl.
I tried the following, the perl script executes fine, but there is nothing to read from stdin:
./cron_extract_section.pl ${SECTION} 2> /dev/null | ssh user#remote perl - ${SECTION} < ./cron_update_section.pl
Do you know if it's possible to do so without modifying the scripts ?
Use the DATA file handle. In example:
Local script to be run on the remote machine:
# script.pl
while(<DATA>) {
print "# $_";
}
__DATA__
Then, run it as:
(cat script.pl && /cron_extract_section.pl ${SECTION}) | ssh $host perl