Programming in an Interpreted language executed by a running Shell

learn more… | top users | synonyms

4
votes
2answers
161 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
695 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
82 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
26 views

Inotify & Rsync - Don't move files before download is completed

I am using a local website which downloads files to my server. Using an Inotify daemon I'm listening for file changes in a specific folder (the one I am downloading to) and executing a script which ...
0
votes
2answers
68 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 http://stackoverflow.com/questions/29308202/running-spark-on-top-...
0
votes
2answers
198 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
527 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
211 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
601 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 $SOURDIR/sample_${i}_[0-9][0-...
0
votes
2answers
902 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
120 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 ...
2
votes
1answer
102 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
52 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
66 views

How to write a shell script to search from a position in file instead to start from beginning of the file again

I am trying to write a shell script to find value stored after a repetitive word in a big file with millions of lines using for loop. After the finding the repetitive word how i make script to start ...
1
vote
1answer
96 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
81 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
233 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
32 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
13 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
1answer
38 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
82 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
57 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
2k 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 https://...
0
votes
1answer
45 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 ...
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
312 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
94 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
100 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
388 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
375 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
493 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
586 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 ...
-2
votes
1answer
36 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
46 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
64 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
288 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 /usr/sbin/...
1
vote
0answers
12 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
136 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
301 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
381 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 modify,attrib,close_write,move,...
1
vote
0answers
188 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 log-...
1
vote
0answers
308 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
62 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
29 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
151 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
34 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
35 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 all-...
0
votes
0answers
61 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
343 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 ...