1
vote
3answers
121 views

find files with non-zero size in shell

I need to get a list of names of files with non-zero size inside a directory. This should be in a shell script, so bash (or a Perl one-liner) would be ideal.
-3
votes
1answer
298 views

Which scripting language to use to asynchronously ssh into equipment, run several commands, parse the output, and save to a file on my computer? [closed]

There are several points I'd like to stress in my question. I'd like to login by asynchronously ssh'ing into our infrastructure equipment. Meaning, I do not want to connect to only one device, do ...
0
votes
3answers
402 views

When to use Bash, when Python/Perl/Ruby? [closed]

What's your rationale for when to write a Bash script and when to use a more powerful scripting language (Python, Perl, Ruby, ...)? I'm finding that very simple scripts are nicer with Bash, but many ...
0
votes
1answer
91 views

script for changing file dates of postfix Mailbox files

I have a Maildir structure, that got wrongly restored from backup and all files have the file date of the restore instead of when they have been created/received. What would be the best way to ...
1
vote
3answers
444 views

Calling sudo within a script that was called with sudo prompts for password even with NOPASSWD

A PHP program I am working with (LConf) calls a script using sudo. I have allowed the user apache to run the script and have tested with sudo -u apache /usr/local/LConf/lconf_deploy.sh. I am being ...
2
votes
1answer
333 views

Calculate average of every 5 samples with rrdtool or other languages

I want to make an average of 5 samples and calculate a single value: Current output - I put resolution of 5 minutes but receive 5 samples: $ rrdtool fetch file.rrd AVERAGE -r 300 --start 1200000000 ...
3
votes
5answers
860 views

File transfer between two servers, no FTP, no web

I am looking to automate the transfer of file in a given directory from one server to another server. they are both on the same network, can ping each-other, and even ssh from one to another. ...
-3
votes
1answer
65 views

bash + create proccess from function before program ended

the following short bash program described how to execute the func1 by process ( func1 & ) func1 is function that do some tests and verification on Linux machines And this program run after ...
2
votes
5answers
749 views

bash + print line every 10 min in bash

I want to print by echo the following "still in process wait another 10 min" every 10 min Please advice what condition needs to add before the echo command in order to print this line every 10 min? ...
2
votes
2answers
270 views

Perl command line + add PATH before string in file

I want to add the PATH - /usr/local/bin/perl befpore string in the file by perl command line ( the perl command line must be in my bash script ) , I have solaris machine the target to add - ...
2
votes
2answers
89 views

perl + Match last number in file and reduce it by one

I want to add the following perl command in my bash script please advice how to change (reduce by one ) the last number that start with "+" character in file with perl ? Example of original file ( ...
0
votes
1answer
710 views

Nagios plugin script not working as expected

I have modified an off-the-shelf Nagios plugin perl script to (in theory) return a one or zero according to the existence, or not, of a file on a remote linux server. The script runs a remote ssh ...
2
votes
2answers
151 views

awk + perl + get two arguments in to awk syntax

please advice what wrong with my awk syntax and how to fix it ( this syntax is in my ksh script ) and I run my script on linux machine my target is to get from the file.txt only the lines that ...
1
vote
1answer
249 views

Perl sendmail attach log files match date format

I want to send log files matching date format, e.g. YYYY-MM-DD-*.log as attachments in Perl script. In BASH, this can be easily done by: [ -f $DIR/explog/$(date "+%Y-%m-%d")-*-host1.log ] && ...
0
votes
2answers
303 views

Mail::Sendmail with attachments and embed Perl in Bash script

1> I want to embed below Perl script in BASH script, and the Message should read from a message.txt file. How to realize this? use Mail::Sendmail; %mail = ( To => 'you@there.com', ...
1
vote
4answers
1k views

Silent and scripted install of CPAN and Perl modules?

I need to install CPAN and some Perl modules automatically in a Scientific Linux (RHEL) installation script. Unfortunately the specific modules I want (at least one of them) cannot be found as RPM:s ...
0
votes
1answer
152 views

ksh + print the last value from parameter ( as $_ in perl)

I need advice - how to print the same last value in ksh scripts without to print param argument for example in perl last value is $_ , but we not have this option in ksh script example - of ksh ...
6
votes
4answers
746 views

Script to automatically install packages

I want to write a bash or perl script to install a number of packages on my debian based machine. I want it to be something like : aptitude install package1 aptitude install package2 But, I do ...
1
vote
1answer
246 views

Execute a Perl script after reboot on Solaris 10

During my activities on Solaris 10 machine I need twice reboot the Solaris unit and after reboot I'd like to run several scripts. Before first reboot I store in /etc/rc3.d/S99myScript some bash ...
2
votes
4answers
845 views

Handy parsing for numbers with unit suffixes?

Let's say you have data with quantities in human-readable format, such as the output of du -h, and want to further operate on those numbers. Let's say you want to pipe your data through grep to do a ...
0
votes
5answers
66 views

Finding matches from one large file in another?

I have two email lists. One is a newline delimited file of just email addresses containing 100k lines and the second file contains email,date,ipaddress newline. It has 4M lines, and contains ...
1
vote
1answer
364 views

Need help on awk/sed/ perl pattern with regex / grep

Sample file output from grep file1:my $dbh = DBI->connect("dbi:mysql:$database_name", $DB_USER, $DB_PASSWD) file2:($dbc,$rc) = mysql_connect($mysql_host,$mysql_user,$mysql_password); The awk ...
0
votes
1answer
116 views

Compare Error logs across service fleet, find unique errors

I'm looking for a tool where I can list the servers to check, the location of the file and it would return a list of the most common errors across those servers (say like 2 or 3 servers for report ...
0
votes
4answers
225 views

How do I rsync an entire folder based on the existence of a specific file type in that folder

I have a server set up that receives movies to a folder. I then serve these movies using DLNA. But in the initial folder where they end up all kind of files end up. Pictures, music, documents etc. I ...
1
vote
1answer
419 views

Setting environment variables for a service without a login shell on Debian

I have created a linux service that runs as a deamon (and gets started from /etc/init.d/X). I need to set some environment variables that can be accessed by the application. Here's the scenario. The ...
1
vote
2answers
2k views

What to do if bash scripts come with an incorrect interpreter path?

I'm trying to install BugZilla on our server. The issue is that perl scripts of BugZilla define the path as /usr/bin/perl, and my perl installation is located at /usr/local/bin/perl. I've had this ...
0
votes
2answers
2k views

How to run linux bash script from web browser?

Hi I have web server on it also. I had made simple bash script using vi editor..which will open file and then add some lines into it at last it will save automatically...and after that 2-3 linux ...