Questions tagged [scripting]

A form of computer programming that — in the context of system administration — lends it self well to automating tasks.

A form of computer programming that — in the context of system administration — lends it self well to automating tasks.

Scripting is usually done in a scripting language. Such scripting languages are often dynamically typed and interpreted, as opposed to compiled languages. Examples of such languages include PowerShell, Perl and Bash.

1826 questions
0
votes
2 answers

Post-startup & Pre-Login shutdown

Is there a way [using a batch file] that I can set a system to shutdown PRE-login but POST-startup? I've tried a scheduled task to run this batch file with the "/SC ONSTART" flag .. That didn't work. I've tried various registry entries…
Tzadok
  • 3
  • 1
0
votes
3 answers

Measuring Program execution time

I would like to call a program from a script, (malwarebytes, chkdsk, A/V scan) and have the script keep track of how long the program ran. Could someone point me in the direction of what I should be looking for to get this accomplished?
Charles
  • 21
  • 1
  • 4
0
votes
1 answer

Parse all text files in a folder using FOR /F command

There are numbers of txt file in a folder. Now I want to open all txt file and print the contents to a single txt file. Condition is, I want to skip first two lines of every txt file. I was trying with following command, but failed. For /F "skip=2"…
Arindam Banerjee
  • 31
  • 1
  • 2
  • 5
0
votes
5 answers

Hey Admins, What's your way to query rdp session opened on a Windows Server and Kill/logoff/Reset a rdp session?

Possible Duplicate: How do I find out which remote desktop sessions are active? Hey Admins, What's the fastest way to find out who is connected (via RDP) to a server ? And also how to reset on the connections ? Thanks in advance
Xavier C
  • 733
  • 2
  • 9
  • 12
0
votes
1 answer

Close a SSH Session when it suspend

I start a ssh session on a remote host and execute a script on the remote host. The Script is an update script that change the remote IP. Now my local bash script hanging on the line with this command: ssh root@ip…
Naxxas
  • 1
0
votes
2 answers

Putting this command into bash script

with help of google , script that measures multicast streams bandwidth. Here it is tcpdump -tnn -i eth1 -f multicast | sort | uniq -c | awk '{print $3,"> "$5,$1*$NF/2*8/1024 " Kbps"}' | awk '$1 > 10' & sleep 2s && pkill -HUP -f tcpdump It turns out…
titus
  • 414
  • 1
  • 7
  • 17
0
votes
1 answer

How to write a script to install multiple things by just executing it

I have a server (centOS) on which I would like to install the staple development tools. Java, Tomcat, and MySql. What is a good way to write a script that can be ran on newly spawned server so that this isn't done manually on each new server.…
Omnipresent
  • 227
  • 2
  • 7
  • 13
0
votes
1 answer

> /dev/tty - What is the purpose of this command?

This is in one of the rc scripts in Red Hat and I want to understand the purpose of > /dev/tty[n] last=0 for i in `LC_ALL=C grep '^[0-9].*respawn:/sbin/mingetty' /etc/inittab | sed 's/^.* tty\([0-9][0-9]*\).*/\1/g'`; do > /dev/tty$i …
user160910
0
votes
1 answer

If I ssh to a remote computer and run a script, do I need to keep my connection for the script to finish executing?

I apologize if this question has been asked before, I wasn't able to find anything with my exact query. I have a rather lengthy script that needs to be run on a remote computer, and it takes about 3 - 5 minutes to finish executing, usually. I'm…
user573117
  • 13
  • 2
0
votes
2 answers

Recursively delete empty folders with verbose output

This should be fairly simple, but I am not sure what i'm missing. I'd like to recursively delete empty directories, and get an output for what's being deleted, this command works for sure, but I just can't print the actions of -excec verbosely.…
kmassada
  • 113
  • 5
0
votes
2 answers

Debian webserver - Crontab error (not running php script)

I've a webserver with several sites and I'm trying to run a script by crontab but it gives me a error (126 and 127) My script is in: /var/www/site1/script.php When I run the command: php /var/www/site1/script.php The script work as normal. I've…
Swim
  • 3
  • 4
0
votes
2 answers

How do I set the Red Hat hostname at boot via a script?

In our computing environment we have a number of virtual machines running Red Hat Enterprise Liunx 6 that need to set their hostname programmaticly when they boot for the first time. Currently they are being set to names along the lines of…
anonymous
  • 267
  • 8
  • 17
0
votes
2 answers

get informations from x servers per ssh by bash script

I've server Master,SlaveA,SlaveB,SlaveC, and want to get eg. the space information from the server by executing one bash script on the master. How can I do that? --case-- 192.168.1.1 - Master 192.168.1.10 - A 192.168.1.11 - B 192.168.1.12 - C Get…
DeLol
  • 1
0
votes
1 answer

Template for use with Outlook 2010 t enable creation of multiple PST's for many users on one system

This is probably not something many people would have a need for but at this company where there is a large turnover, every user has to have IT create their account on a laptop. Even when recycling, the need is still the same. Each account has the…
questorfla
  • 11
  • 4
0
votes
2 answers

imapfilter: how to capture part of the subject in a variable

I get some mails arriving (on an IMAP server) with subject like: [1270503] apple [1272481] bottle [172481] wine [43172481] grapes I need these letters to be moved in INBOX.CSR.number where number is the one standing in "[ ]" s in the subject. The…
asdmin
  • 2,050
  • 17
  • 28