Programming in an Interpreted language executed by a running Shell

learn more… | top users | synonyms

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 ...
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 ...
2
votes
2answers
659 views

Using Gentoo's `ebegin`, `eend` etc under Ubuntu

We're quite fond of the style of the ebegin, eend, eerror, eindent etc commands used by Portage and other tools on Gentoo. The green-yellow-red bullets and standard layout make for very quick spotting ...
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
2answers
175 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 ...
0
votes
2answers
455 views

Bash scripting: Using wildcard

I have two different folders. The first one contains symlbolic links named with the names of my servers (for example: udcedpai101). The second one contains the inventory of my servers where the ...
0
votes
2answers
200 views

While loop does not return control

The following shell script works only for first server and does not loop to the next. I tried 0< before the ssh command but it still does not return to the shell script once connected. #!/bin/sh ...
0
votes
2answers
584 views

Moving files using sftp

I am trying to move files from one location to another on the remote server using sftp below: for i in a b c d do sftp $REMUSR <<EOM>>$OUT 2>&1 rename ...
0
votes
2answers
860 views

Script for search string inside the file for every one hour

I need to write a script where the particular string(alphanumeric) should be searched inside the file with every hour for whole day. And the search should not contain the previous hour results. Time ...
0
votes
2answers
107 views

Script to change MySQL password from command line

I host some websites for people with a simple server. I can't afford nifty things like cpanel, and I don't want to waste memory on a giant blob of perl like webmin. I am wondering if anyone has come ...
0
votes
2answers
100 views

OS X Server script to archive (or empty) a users mailbox every morning

I have a requirement (SpamAssassin 'training') to archive (or delete) two user's (users are junkmail and notjunkmail) inboxes at a given time every day if there is anything in them. Can anyone help ...
2
votes
1answer
94 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?
2
votes
1answer
51 views

Inspecting how $PATH gets created

Is it possible to "listen" to a variable's value during the start of a new shell? I have a script that checks for the $PATH variable in the typical places, but I'd like to try something different. ...
1
vote
1answer
89 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
1answer
79 views

SSH issues: keyfile and host file not working as expected

When I login to server with a key ssh -i /home/me/.ssh/id_rsa server everything goes without glitch. The key is authorized on the server. However if I try to do same from a shell script, I get a ...
1
vote
1answer
222 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
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 ...
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
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 ...
0
votes
1answer
67 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 ...
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
1answer
1k 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
1answer
69 views

Issue with Bash Script On FreeBSD

I have the below bash script set to run every hour via cron as the root user. The purpose of this script is to email us when files have been uploaded to our sftp server and send us the logins. Here is ...
0
votes
1answer
282 views

How to automate input for a repetitive script! Expect in Bash?

I am a junior sys admin. Reason I'm asking this question is because we don't have a senior sys-admin here who is proficient with scripting. Senior guys are at the head office and too busy for ...
0
votes
1answer
93 views

Creating enterprise init script (to support all Linux distros)

I'd like to create my own init script to make my program start at boot and be controlled via "service" utility in most popular Linux distributions. Requirements: it should be portable across ...
0
votes
1answer
99 views

How do I write a script that compares folder/symbolic-link names from two diffrent folders?

I need help in writing a script to create symbolic links. Here is a script that I have been running on background. #!/bin/bash SOURCE="/home/$USER/www" DEST="/var/www" while true; do find $SOURCE ...
0
votes
1answer
374 views

Hudson kills the process at end of the shell script

Im configuring Hudson to automate deployment process. In shell script I start the server using different user and Im able to see the logs which says server is successfully started and able to access ...
0
votes
1answer
370 views

ssh tunnel and rdesktop in one line

To access a windows machine remotely I have to tunnel through a ubuntu server of mine. To setup the tunnel I have ssh -l root -C -L 9999:windowsmachine:23389 myserver Then I have to open another ...
0
votes
1answer
480 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 ...
0
votes
1answer
568 views

Taking BusID output from lspci and storing in a variable

I am trying to get the BusID's of each video card stored in a server and putting them in a variable each to be used for an input to a simple find and replace perl script. How would I go about getting ...
-1
votes
1answer
21 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 ...
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
0answers
53 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 ...
2
votes
0answers
275 views

error in killing tshark from shell script

I'm getting this error: *** glibc detected *** /usr/sbin/tshark: double free or corruption while doing as below, any idea why? #!/bin/bash trap 'my_exit; exit' SIGINT SIGQUIT count=0 ...
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 ...
1
vote
0answers
128 views

Linux: What could be the reason for random fails in updating passwd.byuid by running yppasswd?

In order to allow NOC users in my company to manage users through NIS I've created the following script: #!/bin/bash # This script will simplicate NIS user management. # You will not be able to ...
1
vote
0answers
274 views

How to package shell script file with license key file

I am working on automated shell script for specific task . Before executing task steps I want to validate the license key provided to the customer with a webservice call. Please help me in making ...
1
vote
0answers
350 views

Running inotifywait on startup of machine

I want to start this inotifywait script on startup of the machine, in order to monitor the folders from the moment of booting: #!/bin/bash while inotifywait -r -e ...
1
vote
0answers
184 views

Powershell-Script is not exectued correctly

I have a power-shell-script which is called by a batch-file. The batch calls the script after it has set the execution policy to unrestricted. Currently the script does nothing more than writing a ...
1
vote
0answers
294 views

Bash and background processes PGID and receiving signals

My actual problem is that a process I run in an rcfile in docker as docker run container bash --rcfile rcfile remains attached to the bash session by sharing the PGID which means that when I Ctrl-C an ...
1
vote
0answers
61 views

Obtain the free_memory value in xen

I would like to know if there's an alternative to the command I am currently using to get the real free memory for the system (meaning memory that can be assigned to new domU) xm info | grep ...
1
vote
0answers
119 views

Shell Script to deploy Django

I have yet to find an Amazon Web Services AMI that deploys a Django environment. I want to deploy with mod_wsgi and also include modules like markdown, lxml, beautiful soup, PIL, and others. Is ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
0
votes
0answers
44 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 ...