The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
123 views

Oracle Golden gate version using shell scrip

I am trying to grep the Oracle golden gate from a remote machine, But along with version it is giving some error details also, How do I resolve it ? user@serverhost:/dbei > echo <golgengate ...
0
votes
3answers
201 views

grep + Regular Expressions to match uniq number

My target is to verify if $FILE is a backup file ( backup file ended with xxxx.xx.xx.xx number Example of backup files ls /etc/VRTSvcs/conf/config main.cf.17Dec2012.09.10.14 ...
0
votes
2answers
1k views

Configure the UPS apcupsd demon to run a script?

I have a ups connected to a Linux server with a usb cable, i installed apcupsd demon and i was wondering how to instruct it to run a shell script i created when a special condition occurs? i.e. the ...
0
votes
1answer
281 views

linux cron mysqldump: php exec() vs shell script vs direct command in crontab

The system is running CENTOS 5.8, Apache 2.2.3, MySQL 5.0.95, PHP 5.3.3 We run mysqldump daily for a few databases. It's run via a php script called in crontab. They are run at the same time and ...
0
votes
1answer
89 views

Linux/Solaris verification ( after hostname change ) in files according to hostname rule

According to the following Perl command ( this command part of ksh script ) I can replaced old hostnames with new hostnames in Linux or Solaris previos_machine_name=linux1a ...
1
vote
5answers
151 views

Solutions for scheduling cronjob

I have setup a list of cron, Some of the cron script takes a long time to run (like 1-5 hours, and they are increasing every day). I do not want to run two cron scripts at the same time, as I do not ...
0
votes
2answers
962 views

linux\solaris + print specific date format from file

subject - print file date on solaris as format: yymmdd ( yy - year , mm - month , dd - day ) on Linux machine I type the following command in order to get: file date as the following: ls -l ...
0
votes
2answers
406 views

How to add a variable into a grep command

I'm running the following grep command var=`grep -n "keyword" /var/www/test/testfile.txt` This work just as expected but I need to insert the file name dynamically from a loop like so: var=`grep ...
0
votes
2answers
149 views

linux/solaris + how to verify OS (linux / solaris ) creation date

Please advice – how to verify OS (linux / solaris ) installation creation date which file/packages/other – can be good indication when the operation system was created/installed ? For example I ...
1
vote
3answers
507 views

linux/solaris kill many proccess with one command

Is it possible to kill all find process with one command? I do not want to kill each process as kill -9 25295 , kill -9 11994 , etc.. Rather, what I want is a simple way or command that kill all find ...
0
votes
1answer
228 views

perl + sed + remove lines that start with “#”

please advice I have linux and solaris machines, and I need command that work on both OS I use the following perl line in order to remove all lines that start with "#" why perl command not work , ...
1
vote
1answer
180 views

Tool to correlate logs by timestamp

I have various log files, some with the same format (webserver + webserver SSL), some with different formats and even different timestamps. How can I correlate these log files together in a simple ...
2
votes
2answers
713 views

trap “” HUP v.s Nohup ? How can I run a portion of shell script in nohub mode?

I want to run a shell script over the weekend, but I wanna make sure if the terminal loses the connection, my script won't be terminated. I use nohup for the whole script invokation, but I also want ...
2
votes
2answers
1k views

How can I kill and wait for background processes to finish in a shell script when I Ctrl+C it?

I'm trying to set up a shell script so that it runs background processes, and when I ctrl+C the shell script, it kills the children, then exits. The best that I've managed to come up with is this. It ...
2
votes
1answer
85 views

Distributing a custom command line tool to enterprise servers

I've been tasked with building a command line tool that we will be providing to our enterprise customers so that they can use the API to upload data to our platform. The API works with standard cURL ...
2
votes
2answers
3k views

How to set postgresql user password in bash script

I want to set a password for the default Postgresql server user, postgres. I did it by using: sudo -u postgres psql # \password postgres I want to do this step in many machines, so I would like ...
-4
votes
2answers
347 views

Check a list of passwords strength [closed]

Is there any way to check a list of passwords whether they strong or not? I have a list of passwords, around 2000, and want to check them against this policy Password must contain a minimum of ...
-1
votes
2answers
297 views

Simple dig output?

In a script I want to be able to write an IP address to somewhere easily, so I thought using dig (or a similar command) with back-ticks. However the simplest output I've been able to come up to wrt ...
0
votes
3answers
3k views

Command does not execute in crontab while command itself works just fine

I have this script from Colin Johnson on Github - https://github.com/colinbjohnson/aws-missing-tools/tree/master/ec2-automate-backup It seems great. I have modified it to send email to myself every ...
0
votes
2answers
504 views

Root crontab not executing script

I have a script listed in my roots crontab 07 9 * * * /opt/HLRSDATA_2010_OCT/HLRS_Scheduler_sp.sh > /opt/HLRSDATA_2010_OCT/logs/HLRTKJob.log This script contains the following #!/bin/bash echo ...
0
votes
1answer
100 views

solaris + manipulate lltconfig command

I work on Solaris 10 machines (eg de1a and du1b). Regarding the lltconfig command, is it possible to view only one device (eg NIC e1000g0) and not the entire list? For example I want to get only ...
1
vote
1answer
114 views

solaris + match the network device name according to IP address

how to find the device name as ( e1000g2 , e1000g3 , etc ) according to his IP address on Solaris machine for example ifconfig -a | grep 10.106.134.133 inet 10.106.134.133 netmask ...
1
vote
2answers
120 views

ksh + match and verify two strings in single line

how to match the words linux1a and linux1b from single line ? ( should be performed by ksh ) list="solaris1a Auto global linux1a linux1b" echo $list | .... ? my target is to find ...
0
votes
1answer
294 views

SFTP download the files and then i wanted rename the server files how to do this?

I have to setup with the banking interface where I need to connect to the remote bank and then download the files in the bank server in-box to my local server for further processing so i do following ...
1
vote
1answer
73 views

tar + tar not open all files

When I want to view the following tar file , then tar show the following three files from /var/tmp tar tvf fix.tar install.sh /usr/cti/apps/swp/dir/script1.sh ...
0
votes
2answers
610 views

How to hide/masquerade password in script

I use the following script to change Open Directory (Apple's LDAP) passwords. I don't like leaving the actual password within the script -- is there any way to hide or masquerade this so the script ...
0
votes
4answers
150 views

Assigning environment variables for CRON

I have a .sh script that creates a .tar.gz file and transfer's it to a remote server using RSA keys for authentication. The script will run from terminal but it will not when I try to set it up as a ...
2
votes
2answers
508 views

CentOS 6.2 cron.daily

I created a new file "dbbackup" in /etc/cron.daily that contains a simple database backup script. #!/bin/sh mysqldump -h localhost -u user -p'passord' database_name > ...
2
votes
3answers
180 views

bash + how to match string that include characters and numbers

please advice - what's wrong with my syntax ? ( should not print the "bad interface " ) remark - I work with bash shell ETH_NAME=eth0 ( or any other as eth1 or eth2 .... ) echo $ETH_NAME ...
0
votes
1answer
179 views

How to make a Bash Script take user input for Changing a Password

The following command on OSX will change an Open Directory (Apple's LDAP) password. The $ is the prompt: $ dscl -u diradmin -P 'password' /LDAPv3/127.0.0.1 passwd /Users/username newpassword I ...
0
votes
1answer
372 views

expect script + how to perform case in expect script

the following expect script target is to print the hostname name from linux/solaris machine and according to hostname results expect script will run linux.ksh or solaris.ksh script ...
0
votes
1answer
286 views

expect script + write “if” in expect script

please advice what's wrong with my exepct syntax ( I run expect in ksh script on Solaris 10 machine ) I want to verify if OS is linux so if it true the expect check if prompt is "#" or ">" and ...
1
vote
2answers
200 views

Different behaviour of script locally and over ssh

I have a script on a server-A Script-A #!/bin/bash -l echo "script-A.sh" | change-environment.sh When I ssh onto server-A and execute it, it works fine. However, when I ssh user@server-A ...
1
vote
1answer
118 views

The plugin of munin is always timed out

I want to use munin to make a graph of ttyACM0 in Linux, but munin can not create the graph. I found some information in "munin-node.log". it shows that "Service 'temperature' timed out". So I changed ...
0
votes
2answers
898 views

Shell Script to Start Mysql Server if not running

I have written a shell script to start mysql server & send a mail to admin user if it's restarted via shell script. What i am facing an issue if I run this shell script on terminal it's work ...
0
votes
3answers
239 views

Files copying between servers by creation time

My bash scripting knowledge is very weak that's why I'm asking help here. What is the most effective bash script according to performance to find and copy files from one LINUX server to another using ...
1
vote
1answer
280 views

Configure Postgres on Server A to pg_restore onto Server B (requiring certificate authentication)

I'm trying to configure a PostgreSQL instance running on SERVER_A to connect to another PostgreSQL instance on SERVER_B. I'm running a shell script on SERVER_A that ultimately needs to connect and ...
0
votes
2answers
293 views

Shell script to fix bad filenames? [closed]

I'm IT at my small firm; and, despite my dire warnings, everyone puts files on the server with awful names, including leading & trailing spaces, bad characters (including \ ; / + . < > - ...
0
votes
2answers
2k views

syntax error near unexpected token `then'

I created bash script wich works as Nagios plugin. Here is a part of it: 44 CURDUPLEX=`ethtool $IFACE|grep "Duplex"|cut -d ':' -f 2|xargs` 45 CURSPEED=`ethtool $IFACE|grep "Speed"|cut -d ':' -f ...
-4
votes
2answers
36 views

list the identical words from fiel [closed]

how can I list the identical words from below file using shell script ? list.txt LT R LT MRTD LT MK RR RR example result : LT R MRTD MK RR
-3
votes
2answers
152 views

Split List of ids in to integer and string? [closed]

I am having a list of ids (total 2 lakh), I want to write a shell script to split the ids (string and integer) using shell script . Example given below : IDlist.txt: | LT345 | | R567 | ...
0
votes
2answers
1k views

How to avoid syntax error on missing command line arguments?

How to avoid syntax error on missing command line arguments? Example shell script: var1=$1; var2=$2; echo $var1 echo $var2 var3=`expr $var1 + $var2`; echo $var3 Output : shell>sh ...
1
vote
3answers
3k views

Powershell Parameters

I have a Param block in my script Param ( [Parameter(Mandatory=$True)] [string]$FileLocation, [Parameter(Mandatory=$True)] [string]$password = Read-Host "Type the password you would ...
2
votes
1answer
173 views

Stream tar.gz file from FTP server

Here is the situation: I have a tar.gz file on a FTP server which can contain an arbitrary number of files. Now what I'm trying to accomplish is have this file streamed and uploaded to HDFS through a ...
0
votes
3answers
221 views

How to join a variable number of lines

I have a file with Feature names and a variable number of usernames below: Feature1 user1 user2 Feature2 user3 I'd like to be able to move the usernames to the same line as the Feature name ...
0
votes
1answer
1k views

mysql -e option with variable data - Pass the variable value to insert sql statement in shell script

The following shell script is not inserting the data to the table. How to pass the variable value to insert sql statement in a shell script. id=0 while true do id=`expr $id + 1`; mysql -u root ...
-1
votes
1answer
342 views

linux + print message on the screen after login to linux machine

I have linux machine red-hat 5.1 I want to write ksh/bash script that perform the following Each time that someone login to the linux machine then he will get the following message on the screen ...
1
vote
1answer
395 views

Can't restart mysql from cron job

I have a problem where MySQL (running on Ubuntu 12.04 with all latest updates) dies after a few days so put this script into a cron job that runs as root every 60 seconds. Everything works except ...
2
votes
1answer
168 views

shell variable value not storing inside file

I wrote following script, which generate random password and store it in file pass1=</dev/urandom tr -dc _A-Z-a-z-0-9|head -c8 echo $pass1 echo "$pass1" >/tmp/a Above script printing ...
1
vote
4answers
136 views

How to execute shell scrips without creating files

How is it possible to execute a shell script without creating a file? For example assume I have the following script (testscript): #!/bin/bash function run_free() { free -m } run_free I then of ...