Questions tagged [shell-scripting]

Programming in an Interpreted language executed by a running Shell

Generic programming in an Interpreted language (as opposed to compiled) executed by a running Shell. Sometimes referred to as "Glue Code" due to the practice of managing the execution and output of one or more compiled binaries and passing said output to another series of commands.

621 questions
0
votes
1 answer

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 "AlwaysZipAttachments" which it set to "0". Now…
Doug
  • 11
  • 2
0
votes
1 answer

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-pair/single-pair from serverlist.txt file ,the…
0
votes
1 answer

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 every db shoudl created and sent using ftp I…
Andrus
  • 169
  • 4
  • 12
0
votes
1 answer

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 something like: nmap -sP 10.40.. | grep 'is up' |…
0
votes
1 answer

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 distinguish them. My idea is finding binlogs by…
technoob
  • 142
  • 1
  • 14
0
votes
1 answer

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

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 the pid of rsync, and tells tar command to start…
technoob
  • 142
  • 1
  • 14
0
votes
1 answer

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 an Asustor NAS device. Here's the…
Craig
  • 141
  • 1
  • 1
  • 10
0
votes
1 answer

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 & wait ; do echo "Server '$NAME' crashed with exit code $?. …
0
votes
1 answer

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` \n----------------------------------" aws ec2 describe-instances…
0
votes
1 answer

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 command, but I'm asking if there's something better…
MaxChinni
  • 101
  • 2
0
votes
4 answers

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 that scp command output is same as the last stdout,…
gkns
  • 111
  • 1
  • 5
0
votes
2 answers

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 equivalent for zfs or nfs? To breakdown the usage, it…
user55570
  • 458
  • 6
  • 18
0
votes
1 answer

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 it like: user ALL=(ALL) NOPASSWD: /sbin/vgs --units…
undefine
  • 1,046
  • 9
  • 21
0
votes
1 answer

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 script which will automatically restart the VPS…
0
votes
1 answer

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 are turned on automatically as part of auto…