Programming in an Interpreted language executed by a running Shell

learn more… | top users | synonyms

-1
votes
1answer
20 views

Write Python Output to File in Cronjob

I have a script (/home/user/script.sh): #!/bin/bash /usr/bin/python /home/user/program.py >> /home/user/logs/out.log & and it is working. The output from the python script is written to ...
6
votes
4answers
1k views

Run a script from anywhere

I have a script: #!/bin/bash echo "$(dirname $(readlink -e $1))/$(basename $1)" that sits here: /home/myuser/bin/abspath.sh which has execute permissions. If I run echo $PATH I get the following: ...
0
votes
1answer
30 views

shell script for geting mysql user grants details

I am trying to get mysql user grant details and echo it to out file hari=mysql -sN -e "show grants for mysqladm"; echo $hari GRANT ALL PRIVILEGES ON *prod_server_list.txt stage_server_list.txt ...
-1
votes
1answer
39 views

Write shell script that listens to a port and executes an action

Could anyone give me directions as for how to write a shell script that constantly listens to a port and when someone/something sends an HTTP request to that port, it executes an action as sudo? I ...
-2
votes
0answers
24 views

Remove same php code from all php files [on hold]

I need to remove everything between following tags in all php files using ssh <?php $rfghoh = $rfghoh=$yuoopi-1; ?> Thanks
0
votes
0answers
9 views

How to rename bulk files in Unix Shell Script [closed]

can someone please help me how to bulk rename below file? Original: TEST_XXXXX_41574983_41574992_03312016.221034.DAT Expected: ...
0
votes
1answer
14 views

How can I run Spark on a cluster using Slurm?

I have written a program example.jar which uses a spark context. How can I run this on a cluster which uses Slurm? This is related to ...
0
votes
0answers
13 views

elinks | dump after form submit

i'm trying to find a way, to dump the content of a page, when form is submitted by elinks. /usr/bin/elinks -auto-submit 1 -eval 'set document.browse.forms.confirm_submit = 0' $LINK If -dump is ...
1
vote
1answer
42 views

ZFS Send Script works when run manually but not in Cron (Already tried common solutions)

Script on sending end is as follows: #!/bin/sh #Variables bigdata=vid-zfs-live/bigdata today=`gdate +%m-%d-%y` yesterday=`gdate -d'yesterday' +%m-%d-%y` #Actions zfs snapshot -r ...
0
votes
2answers
32 views

script with multiple (more then 100) select options

I've been burning my brains out before finally decided to ask it here. I'm new in linux/bash scripting. So there goes my question: I'm using this little script in order to block certain countries ...
-2
votes
1answer
34 views

Script to remove suspended accounts automatically from Linux server [closed]

I have Linux hosting server with centOS, which have WHM installed on it. To reduce the costing and mis-usage of Disk space i am creating a shell-script which automatically removes the suspended ...
0
votes
0answers
59 views

Ssh into a remote machine and execute a script using “expect”

I have a script named serverbounce.sh on server A. However, my Hudson home is on a server B. I want to execute my script serverbounce.sh on server A itself.For this performed the following: a. Created ...
-1
votes
1answer
28 views

env not working in FreeBSD cronjob [duplicate]

On my FreeBSD server, I have setup a cron script for backups using Duplicity. This script is as follows: #!/bin/sh export PASSPHRASE= export FTP_PASSWORD= keyid= remote= excludelist= ...
0
votes
1answer
55 views

Installing a software in multiple linux machines using shell scripting in one machine

I will login to one Linux instance using ssh - putty and my goal is to install a software (for ex: I need to download oracle and install it) on 5 Linux machines with one shell script when I run that ...
0
votes
1answer
26 views

Convert $no_proxy to gsettings ignore-hosts

In order to use Chrome in Ubuntu and have it respect some hosts in $no_proxy, I need to set those comma-separated values with gsettings set org.gnome.system.proxy ignore-hosts <no-proxy> where ...
0
votes
0answers
28 views

Crontab by hostname

My system is having 3 nodes and the cron scheduling is defined in one of these 3 nodes. So while checking with crontab -l at times I am getting proper cron listings at times I am not as the node ...
-1
votes
1answer
49 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
7 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
52 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
32 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
132 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
35 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
30 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
32 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
49 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
66 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
65 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
140 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
38 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
77 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
20 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
84 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
126 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
103 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
11 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
277 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
136 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
115 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
77 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
103 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
82 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
344 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
260 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
27 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
50 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
124 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 ...
2
votes
2answers
2k 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
78 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
148 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 ...