Programming in an Interpreted language executed by a running Shell

learn more… | top users | synonyms

-1
votes
1answer
23 views

bash scripts work fine when I run it from command line but not from cron [duplicate]

I have this bash script in runtests.sh file #!/bin/bash cd /Library/WebServer/Documents/protractor_clipboards protractor testscript.js When I do this on terminal ./runtests.sh But when I try to ...
0
votes
0answers
5 views

WinZip Courier automatically zipping email attachments

I am trying to create a pre-configured MSI file for WinZip Courier 6 (latest version) within a CMD script (eventually deploying on SCCM). The main MSI property to turn off automatic zipping is ...
2
votes
0answers
25 views

Analyzing squid3 access.log log files with a all-in-one shell script

I'm just going to write a shell script that me the essential functions such as SARG offers. Sort by URLs with most hits (Top100 in 10min out of 10k) Sum of status / error codes As well as sorting by ...
0
votes
0answers
26 views

how to execute bash script with args in parallel on all the remote server if the remote server in the from of pair

Please read carefully problem first and then give solution................... we are having 3 files in directory myscript.sh (the myscript.sh file contain many function and starts/stop to ...
2
votes
1answer
42 views

Vagrant provision : shell script install mariadb-server on Debian prompt error

I'm looking for provisioning a Debian 8.2 Virtualbox VM with MariaDB 10. I use the following : sudo export DEBIAN_FRONTEND=noninteractive sudo debconf-set-selections <<< "mariadb-server ...
0
votes
1answer
25 views

How to call ftp script from main script

I'm lookign for a way to create backups from several databases and send result files to server in Debian Linux 6 (Sqeeze) from crontab job There are databases named database1 .. database4 Backup from ...
2
votes
1answer
18 views

How properly handle deletion of pid.file in service script

I'm trying to write service script for application. So I can control it like this: ./myscript.sh start|stop|status On startup pid.file with process id creates, and based on it I can check status ...
2
votes
1answer
28 views

Does script execution time cut into idle logout time with ssh?

On one of our Mac OS X servers, we have set the following in /etc/ssh_config: # Keep idle connections alive for 10 minutes Host * ServerAliveInterval 600 Two questions: 1) Is this a good way ...
0
votes
0answers
21 views

Querying RDWeb for /rdweb/pages/webfeed.aspx

Question: How can you pull /rdweb/pages/webfeed.aspx from a Server 2012 R2 TS through a shell script on a Linux system. Purpose: I wish to enhance usability of xfreerdp by having something like a ...
0
votes
1answer
33 views

getting a list of live assets using nmap and script?

I'm playing around with a way to find all network assets from the command line that will return an IP, a hostname, and then have a way to see all interfaces associated with that host. I was using ...
3
votes
1answer
52 views

Is there a way to Controle the IDRAC Console through scripts

is there a way to Controle the IDRAC Console through scripts, i.e. say if i am installing OS on Bare Metal Server and i only have IDRAC as a source and want to select the OPtion 1 or 2 or 3, instead ...
4
votes
2answers
89 views

How do I programmatically convert putty logs to human-readable, searchable files?

Background: I have a Windows 7 workstation and use PuTTY for SSH connectivity to Linux servers with session logging enabled. I previously used the Printable output option but that has the benefit of ...
3
votes
0answers
32 views

OSX Terminal.app seems to become 'suspended' unless I VNC into the Mac

So I have a bit of complicated setup, but let me see if I can simplify I am running a mono application on a remote OSX machine. This application can occasionally hard-crash the mono runtime. There ...
2
votes
1answer
63 views

I need a command to create a unique fingerprint from unix machine

I need to create a serial number for my application in a Unix machine. The generated serial number should be unique Do not change over time (Only changes after hard drive or mother board changes) Do ...
0
votes
1answer
17 views

How to find the latest binlog of MariaDB by shell script?

I want to find the latest mysql binary log in /var/log/mysql/, but I found the name of binlog is mariadb-bin.0000*, and we also have mysql-bin.index, so it's really hard for me to use shell script to ...
2
votes
1answer
47 views

How can I use openssl to get results from HTTP GET requests?

I need to use openssl to perform some HTTP GET requests in a shell script. The line I'm using to do this right now is shown below. This is parsing the content of an XML response of the following ...
1
vote
1answer
62 views

Bash: How do I pass “command not found” text into my trap function?

I have the following: test.sh . Foo.sh Foo.bar Foo.baz Foo.blah and Foo.sh function Foo.bar() { echo 'I am a bar!' } function Foo.baz() { echo 'But, I am a baz!' } function ...
0
votes
1answer
63 views

How to monitor the pid of each command in shell script? [duplicate]

In my situation, I have one shell script running rsync and tar in the background. Rsync is used to transfer files, and tar is doing compression after rsync is finished. My problem is how to monitor ...
1
vote
0answers
7 views

Simple way of restarting crashed processes in server within 3 attempts if its exceed need to skip the script?

I have one file name hello.sh. I'm running that file at every 30 mins from crontab. In hello.sh, I have script for checking the service whether it is running or not. if its not running then it will ...
0
votes
0answers
193 views

Restart ffmpeg process streaming rtmp video if it fails using shell script

We use ffmpeg to forward streams live. Often due to unknown reasons or due to the stream stopping temporarily the command stops running in the background. What's the best way to monitor and continue ...
1
vote
1answer
83 views

subshell is not created if run commands without a path?

I'm reading the book "Linux Command Line and Shell Scripting Bible" 3rd edition. On page 279, here I quote: "Command substitution creates what's called a subshell to run the enclosed command. A ...
0
votes
1answer
85 views

Script Works in Terminal, but Not as .sh

I have a script that works in the terminal perfectly, but for some reason won't fire off either in cron or when I run the script manually. I don't know if it makes a difference, but it's running on ...
0
votes
1answer
20 views

How to send a group of command in background

I'm writing my own generic init script, I've taken strategies from here and there and come up with trap 'kill $(jobs -p)' EXIT; until $DAEMON $DAEMONOPTS > /var/log/${NAME}.log 2>&1 & ...
1
vote
2answers
64 views

Get a file's ctime, atime, mtime and extended attributes

I would like to display a file's ctime, mtime and atime along with whether it has extended attributes or not. There are 2 commands that can do this but I have not been able to combine them into a ...
0
votes
1answer
64 views

How to create an AMI excluding all attached volumes for all instance within VPC using shell script

I have written script to find instance-id from VPC n create AMI of each instance-id : #!/bin/bash #Script to Automate AMI backup echo "----------------------------------\n `date` ...
1
vote
1answer
51 views

Get OpenVPN client IP script

My machine get's an IP from OpenVPN server when connecting to the VPN gateway. This is tun0 on Ubuntu. I assume naming might be different for other systems that may connect to OpenVPN gateway. Is ...
1
vote
1answer
204 views

A way to update the plain text password to ssha in Open ldap for 400K Users

Is there any command/extension available to update the "userPassword" attribute from a user object in LDAP server to SSHA hashed passsword from plain text? we found that users in LADP are stored in ...
-1
votes
1answer
193 views

Bash add entry to fstab by script [closed]

I'm newbies in bash scripting and i try to write script that add entry for cifs windows share to fstab. I writed a litle script but i'm not shure if it will work fine. I haven't linux to test it Can ...
0
votes
0answers
26 views

bash scripting and comparing 2 directories - Beginner [duplicate]

My problem is that i have to check what files are included in the $directory, then i have to make a new file with name specified by me and compare if the name doesn't already exist in this directory ( ...
0
votes
1answer
40 views

find files which are not currently in use

I'm trying to archive some older files, but don't want to touch all the files which are currently in use. What's the best way to ask find to exclude "in use" files? Right now I'm working on this ...
0
votes
3answers
89 views

Strange behavior of SCP through .sh file

I'm hitting a strange issue with SCP on cygwin, scp $HOME/deploy.sh user@host:/tmp works fine, files get copied to the remote system. But the same command inside a test.sh won't work. I can see ...
1
vote
2answers
927 views

Shell script for docker ps -a | grep to find number of certain containers running

I want to write a script that is executed by my development build server that will remove any 'similar' docker containers before building and running a new container. Below is pseudo code for the ...
1
vote
1answer
58 views

Trying to get pid from a script running as su -c

I am trying to get these scripts to work in an environment where the java application needs to run as user foobar no matter if it is started as root or foobar. So these are my modifications to the ...
0
votes
2answers
113 views

What are the best ways to monitor and report disk usage on solaris?

df and du provides a total view of usage but the problem with these is that they are not broken down per user. Is there a tool that does this? I found quot but that only works on ufs. Is there an ...
0
votes
4answers
607 views

Check if remote mysql is running

I want a bash shell script that i can run using a cron job to check if mysql on a remote server is running. If it is, then do nothing, other start the server. The cronjob will be checking the remote ...
0
votes
2answers
673 views

#!/usr/bin/expect not working

This is probably an easy question, however have a simple expect script that I've add the executable bit to that seems to be ignoring the #!/usr/bin/expect interpreter line. Further more, it also ...
0
votes
1answer
21 views

how to put tabulator as parameter for sudo in sudoers file

I would like to give for specific user allowing to put tabulator as parameter to program. Full invoking looks like: sudo /sbin/vgs --units b --nosuffix --noheadings --separator 'TAB' I try to put ...
0
votes
1answer
636 views

Using curl with cookies

I hope someone can help me out on this one. I have been trying this for a while now, with all sorts of variations and cannot seem to get this to work. I am trying to script a way to log in to ...
0
votes
0answers
42 views

Error with a specific bash script

I must first of all shamefully admit that I unfortunately know nothing about scripts... I am simply trying to use one that seems to fit my goal. I am running a VPS node with OpenVZ, and I need a ...
2
votes
1answer
88 views

Echo each shell script command with a timestamp

set -x or set -v prints every executed command. How do I get the command printed with the time when the command started executing?
1
vote
2answers
312 views

Special char or wildcard in awk field separator

Would appreciate to know about the special char or wildcard in the following command: /sbin/ifconfig eth0 | awk -F ' *|:' '/inet addr/{print $4}' What does the code below mean? awk -F ' *|:' '
0
votes
0answers
34 views

Debian: passwd command not found [duplicate]

I don't know why, and what's the resolution, but on my Debian I have this problem: root@server:~# passwd -bash: passwd: command not found How can I resolve this ? I had same problem with shutdown ...
1
vote
1answer
77 views

Bash Script to set Linux OS

I'm working on a bash script and ran into an issue. I'm pushing what I know from using normal if/fi statements and trying to use them to set variables related to picking up the OS version, such as RH ...
1
vote
0answers
151 views

Gitlab custom hook issues [closed]

I am implementing a custom gitlab hook. While some one pushes in master, I want to update a specific file. Then commit this change and push it to remote origin. The hook looks like below: ...
-1
votes
1answer
284 views

How to run a shell script on all amazon ec2 instances that are part of a autoscaling group?

Can anyone please tell me how to run a shell script on all the ec2 instances that are part of a auto scaling group. The scenario is that i have a script that i want to run on many ec2 instances that ...
2
votes
2answers
1k views

password check in bash script calling on expect

Background: I have to copy a file from one server, to over 100 servers in a test environment. once the file is copied, it requires to have the permissions on the file changed/verified. These are all ...
1
vote
1answer
103 views

Export or Forward /var/spool/mail/USER (readable for customer)

there are some bounce mails in the /var/spool/mail/USER directory that failed to send. Now the customer receives all of those mails from us because he does not have direct access to them. I can ...
1
vote
1answer
141 views

What does a minus sign inside of dollar brackets of a shell script mean?

In an existing shell script, I'm seeing some variables referenced that either include or end with a minus sign. For example: PID=${PID-/run/unicorn.pid} and: run_by_init() { ([ "${previous-}" ...
0
votes
1answer
180 views

Bash linux increment variable

i am trying to increment a variable name inside a for loop to get 4 dynamic variable in each loop, this is an example while read line do for n in `seq 1 4` do ...
0
votes
2answers
135 views

Can I get an array as an option argument in bash script

I am writing a shell script and wants to pass multiple options in an argument. Is it possible to do that like using getopts? Requirement example: ./shell.sh -d db1 db2 should pass the values db1 ...