General :: Reading A File From A Remote Server?

Oct 15, 2010

I have an situation where I want to read a file into my script that lie on a remote server. I have ssh-keys set up just don't know how to do this.

View 7 Replies


ADVERTISEMENT

General :: Why Is Reading A FILE Faster Than Reading A VARIABLE?

May 4, 2011

I don't understand the results of a simple performance test I ran using two basic scripts (running on a high end server):

perfVar.zsh :

#!/bin/zsh -f
MYVAR=`cat $1`
for i in {1..10}

[code]...

Performance test result:

> time ./perfVar.zsh BigTextFile > /dev/null
./perfVar.zsh FE > /dev/null 6.86s user 0.32s system 100% cpu 7.177 total
> time ./perfCat.zsh BigTextFile > /dev/null
./perfCat.zsh FE > /dev/null 0.01s user 0.10s system 91% cpu 0.118 total

I would have thought that accessing a VARIABLE was way faster than reading a FILE on the file system... Why this result ?Is there a way to optimize the perfCat.zsh script by reducing the number of accesses to the file system ?

View 3 Replies View Related

General :: Parse File From Remote Server To Caculate Count Of String Existence In That File?

Aug 30, 2010

I need to parse the file of same name which exist on different servers and calculate the count of string existed in both files.Say a file abc.log exist on 2 servers.I want to search for string "test" on both files and calculate the total count of search string's existence.For example if file abc.log on server 1 has string "test" 2 times
and file abc.log on server 2 has string "test" 4 times.then the output will beStringName : Countexampletest : 6 timesNote : I have created the password less connectivity using ssh-keygen.

View 2 Replies View Related

General :: Use A File In Remote Server?

Apr 2, 2011

I have a file ( /tmp/my_file.txt) in local server , I have a script as below , it works fine.

for file in /tmp/my_file.txt ; do

done

Now , if the file ( /tmp/my_file.txt ) is in remote server , can advise what can i do ?

View 3 Replies View Related

General :: Grep Contents Of File On Remote Server?

Sep 24, 2010

I am attempting to grep the contents of a key file I have SCP'd to a remote server. I am able to cat it:

Code:
[bluethundr@LBSD2:~]$:ssh root@sum1 cat /root/id_rsa.pub
root@lcent01.summitnjhome.com's password:

[code]...

View 5 Replies View Related

General :: Delete A File On A Remote Server Using Shell Scripting?

Jul 18, 2010

delete a file on a remote server using shell scripting.

View 14 Replies View Related

General :: Reading Contents Of PDF File?

Jun 8, 2011

is there any API to read content of PDF file & store it in buffer?

View 14 Replies View Related

General :: Reading Info From One File In To Another?

Nov 17, 2010

been playing around making a server to play some games on running centos 5.5

what ive spent a while looking for (a few days) is a way to make a file which i will call startup this will contain some values

Code:
mod_directory="etpub"
port="27960"
log_name="console.log"
vm="0"
dedicated="2"

[Code].....

View 1 Replies View Related

General :: Reading The Contents Of A .bkf File Using A Non-Microsoft OS?

Apr 20, 2010

I have a .bkf backup file, created by the Backup utility that Microsoft provides with Windows XP. Is there a way to read the contents of the file using a non-Microsoft OS, preferably Mac OS X or Linux?

View 1 Replies View Related

General :: Bash: Reading File Into Array?

Dec 2, 2010

I have a file named file.txt with the following contents

Code:

19 man
24 house
44 dyam
90 random

I want to read the file into array and store each line in each index. I've tried using the following code.

Code:

dataarray=($( < file.txt ))

It stores each word in each index rather than each line in each index.

View 3 Replies View Related

General :: Oracle - Reading Alert Log File?

Mar 2, 2011

My requirement is that I wanted a shell script which should read the alert.log(oracle) and should send the alert to my email if any error encountered on daily basis. I have a script which does the same job but at the same time it creates a new alert.log whenever any error occur. But I don't want the new alert log I wanted to read the same alert log daily and if any new error come should alert as email.

View 3 Replies View Related

General :: Reading File Into Variable In Bash?

Mar 21, 2011

I know that cat can output the file, but how do you store that output in a variable to process:

Code:

CONTENT=cat file.txt

This doesn't seem to work?

View 3 Replies View Related

General :: Reading Changing File In Real Time

May 27, 2010

I know this command exists I just can't seem to find it. I want to see the last few lines of a file as more are added in real time. Can someone point me in the right direction?

View 2 Replies View Related

Server :: Remote MySQL Server Connection Dies After Wget Large File

Feb 3, 2011

We have 2 servers, 1 is the webserver and the other is the Mysql server.

When transfering a 2GB file from the webserver to the Mysql server.

The webserver's connection to the mysql DB server dies completely.

Need to restart the MYSQL process in order for it to come back online.

During this connection downtime, when using phpmyadmin on the mysql server shows no problem running queries etc.

View 2 Replies View Related

General :: Reading Numbers From Text File And Storing In Array?

May 26, 2010

I'm writing a bash script where I read a text file (containing a column of numbers) and store each line in an array. There seem to be some problems with the whole thing however, but only for some files and not others. Here's what I do:

Code:
#!/bin/bash
file=time_notOk.txt ### The file with a column of numbers
i=0 ### Array counter
### Read the file

[Code]....

View 3 Replies View Related

General :: Error Opening Matrix File (null) For Reading"

Dec 22, 2010

I have installed CUDA-BLASTP on C2050.It is giving me an Error:"Bad address Error opening matrix file (null) for reading" while i am running with following query file and dataset:

./CUDA-BLASTP -i ./data/raimondii_contigs.fasta -d ./data/DB_sorted.fasta

and i am using BLOSUM62 as a matrix file which is already present in package.

And getting the error:"Error happened when the number of GPUs is 0" while i am running CUDABLASTP with a part of dataset taking as a query file and dataset is same. above mentioned error is comming from file "CUDA_Blast.cu" included in package.

else
{
printf("Error happened when the number of GPUs is %d
", localGPU_N);
exit(0);
}

View 2 Replies View Related

General :: FTP Client As Like FTPS On Windows - Reading Series Of Ftp Commands From A Txt File

Apr 20, 2011

I am very new to Linux and trying to learn the shell scripting. Just to know is there any client in linux which does the same task as FTPS on windows. FTPS on windows can read series of FTP command from a txt file and execute them. Is there any way to do that same task, i mean reading series of ftp commands from a txt file, on linux suing shell or perl (any module)?

View 2 Replies View Related

General :: Bash + Reading Values (numbers) From A File And Storing Them Into An Array?

Nov 4, 2010

I have to read a couple of numbers from a random.txt file. In this .txt file there are random numbers. They are separated by a space. Example if you opened test.txt:

test.txt :1 6 1 3 6 8 10 2 4

I would like to read those numbers using CAT and store them into an array:

numlen=${#num[*]} - (must be like this because it is a part of a larger program)

View 5 Replies View Related

Ubuntu Servers :: FTP From Server To Remote File Server?

Jul 6, 2010

I support a small business which runs a headless Ubuntu Server (10.04 32bit) as a file server which is accessed by Windows machines.Although the company has it's own back-up procedure they have decided to back-up some (none sensitive) files online. The have chosen FileFactory (http://www.filefactory.com/) as the host for this. FileFactory allows files to be uploaded to their server by FTP however I do not know how to set this up on the server.

The idea, if it is possible, is to connect to FileFactory through FTP and then synchronise the data using an Rsync command.I normally access the server through Webmin and it has vsFTP installed. I can access the company's server by FTP from inside and outside of the network so I know that vsFTP is working for incomming connections however I cannot work out how to configure it to connect to the FileFactory server.

View 3 Replies View Related

Hardware :: Reading Raw Codes From A Remote Control With A Tekram IR-210B Serial Dongle?

Oct 1, 2010

I need to read raw codes from various remote controls (for TVs, DVRs, etc). For that I use a Tekram IR-210B serial dongle. At least I try, since I can't put any meaning on the codes I get by reading /dev/ttyS0 . I tried various tricks, including reading /dev/ttyS0 as a stream, using the Linux irda stack, lirc, similar experiments with Windows 2000/XP too, but nothing seems to work (at least not as I am expecting). The technical documentation is non-existant, Tekram e-mail support doesn't answer (or returns non-existant user errors when it does), browsing the kernel file tekram.c didn't help either, so I'm kind of stuck.

Because I won't need this for more than a few days (or weeks at the very most), I don't need a rock-solid solution, what I need is nothing mode than read raw (presumably RC-5) codes from a few remote controls (2 of them being from mainstream brands, another one claiming to be universal). So if nothing else a dirty trick will perfectly do.

Ideally, a technical documention on how to get the raw codes from the remote controls is what I am looking for. Something that tells me what baud rate to use, which parity, number of stop bits, and how to decode the stream (as I suspect it doesn't contain the raw codes as-is). However, I will be happy with any advice you may have on where to look or what tricks I might try.

View 4 Replies View Related

General :: Create A Multiple Files By Reading A Input File And Changing The Contents?

Sep 16, 2009

Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me .

I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer.

I want to create a mutiple output files with each file having a seperate code which is stored in text file and create XYZ_222_999_YYYYMMDD_1.TXT . and add date in the contents next to series of numbers .Like this

Before change the file looks like this

file name XYZ_111_999_YYYYMMDD_1.TXT

001,19SEP2009-14:05:05,000000003
1234
4567
6785
END_OF_DATA

[Code]....

View 4 Replies View Related

General :: Reading A .CSV File And Then Calculating Average Per Minute Basis In Shell Script

Apr 23, 2010

I am new to shell script and to this form as well, I did try to search for a similar post like mine here, but could not find one.

Here is what I'm trying to do:

I am trying to grep server logs to find a specific string and then capture the time stamp and the value of that grep string in them. The log file prints out messages on per sec basis.

My script is able to grep the server logs for the entire period of my load runs and then outputted it to a .csv file too.

Unfortunately this .csv file is too large to extract it on my PC and to generate graphs as it exceeds the excel limit. I need some help on how to read this .csv file in a shell script and then take an average on per min basis before I can export it out on my desktop and generate graphs for analysis. example of the out in my .csv file:

View 1 Replies View Related

Server :: Error: Cannot Open Log File '/usr/local/nagios/var/archives/nagios-07-08-2011-00.log' For Reading?

Jul 9, 2011

Error: Cannot open log file '/usr/local/nagios/var/archives/nagios-07-08-2011-00.log' for reading!

View 2 Replies View Related

General :: Script To Ftp A File To Remote Machine - Log The Output To A File?

Feb 5, 2010

I am using below script to ftp a file to remote machine

Code:

#!/bin/bash
ftp -nv <<EOF
open ${SERVER}

[code]....

When I execute the above file its working fine and displaying output on to the screen. How can I log the output to a file?

View 7 Replies View Related

Ubuntu :: Copying File To A Remote Ftp Server With Bash

Jan 10, 2011

I'm hoping to set up a cron job that takes a file and copies it to a remote password protected FTP server. I've got a command that formats the file with the correct name and I've put it in the anacron file in /etc/cron.d (which I think is right, haven't tested it yet).I'm not sure how to copy the file to a remote server though. I do actually have the ftp server bookmarked in my places menu. So is there a simple way of suppling a file path that will put it straight into that folder? The only problem I can see with this is that the connection won't be open continuously, so would need to be re-opened when needed (I could presumably save the password in the keyring so that I don't need to be there to type it in).

Or maybe set up a cron job that connects to and mounts the ftp server a minute before it has to copy the file over?

View 9 Replies View Related

Programming :: PHP - Connection To Remote Server To Edit File?

Mar 14, 2010

I have a webGUI in php where users can make certain settings. How can I edit a file on a remote server from my php webserver? Currently I use my FTP client, vsFTPd and a chrooted user in a specific directory where the file resides. I think this is pretty save as long a nobody else uses my FTPclient. How can I make changes to this file on the remote server from within my php-code on my webserver ?? (so that not I need to make the changes but my users can do it from a html-form) I found this but the credentials for the FTP-connection are plain :

<?php
$file = fopen ("ftp://loginasswd@server", "w");
if (!$file) {
echo "<p>Unable to open remote file for writing.
";

[code].....

I use https for the webGUI, but I guess this does not mean the connection to the remote server will be encrypted also ? Can I use my FTP-user (has no shell) from within php to edit the file ?

View 12 Replies View Related

Server :: Error. NT_STATUS_ACCESS_DENIED Opening Remote File History.txt

Sep 2, 2010

I have install samba server.Now i am trying to shift data from linux machine to windows machine.it gives following error. NT_STATUS_ACCESS_DENIED opening remote file history.txt firewall and iptables are also disabled.

View 1 Replies View Related

Ubuntu :: Copying File - Error Reading From File Input/output

Jun 29, 2010

I have a 7.2 GB file (VMWare virtual machine file) that I am trying to copy from its original location to the another folder OR to external hard drive...each time I try to do this, I always get the following error after the copying process reach 'exactly' 1.4 GB

Error reading from file input/output error

And I have to either Cancel or Skip

I've tried to split the files to smaller pieces but the idea didn't work as I still get the same error whenever I try to compress/ split or do any operation with this file. how I can copy this file?

View 2 Replies View Related

Ubuntu Servers :: Can't Connect To Server (file Or Remote Terminal) From Laptop

Jan 23, 2011

I have an ubuntu fileserver and an ubuntu laptop both running 10.10.For some reason I can't connect to the server (file or remote terminal) from the laptop, even though I can access ssh through terminal on my mac and have been able to mount the filesystem on another computer running the ubuntu liveCD. I just get the error 'no route to host'.I've tried turning off the firewall on the laptop and re-installing ssh on both computers, but I don't have a clue what to do next!

View 9 Replies View Related

Server :: Change A Line In A File And Send To A Remote Machine With Rsync?

Nov 20, 2010

I'm configuring an rsync between 2 machines, A_Server --> B_Server, using the following script:Quote:

#!/bin/bash
#
# Script de backup a trav�s de Rsync desde RMP-1 hasta RMP-2.

[code]....

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved