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
6
votes
6 answers

How to Run a script when a mail arrives in mail server? (Debian)

I want to parse and insert some information from the mail that just arrived in a mission critical application's mail server. I there any way to configure my mail server so that it run a script when mail arrives. Although I have a debian system but…
Rahul Prasad
  • 257
  • 3
  • 4
  • 9
6
votes
3 answers

Run shell script on a command

I want to run a shell script when date -s command is used. For example i want to log the command to the file /tmp/user.log by executing the following command in the shell script logger -p user.notice "date -s command executed" -f…
LinuxPenseur
  • 443
  • 1
  • 6
  • 16
6
votes
3 answers

Use GRUB/GRUB2 to PXE boot OS image

Asked this in stackoverflow but they recommended I post this here: Here is the situation I am in: I currently have a Windows drive that boots XP. The BIOS does not support PXE booting so this is out of the question. Therefore, I was thinking I could…
Jack
  • 63
  • 2
  • 4
6
votes
4 answers

Can I create and manipulate unix "screens" in a script?

I have a work environment on my Ubuntu laptop in which I want to use three different screens. Eg. in terminal, I usually write screen -S mywork run_server_1 then, ctrl-a c to create a second screen run_server_2 etc. I'd like to write a script to…
interstar
  • 1,281
  • 4
  • 18
  • 23
6
votes
2 answers

Create kickstart configuration file from existing configuration

Is there a script or another way to automatically generate a kickstart configuration file from the system state of an existing server so that the file can be use to replicate (not clone) the configuration of the system in another install? I know…
ÜMineiro
  • 63
  • 1
  • 1
  • 5
6
votes
6 answers

How to remove a tagged block of text in a file?

How can I remove all instances of tagged blocks of text in a file with sed, grep, or another program? If I have a file which contains: random text // START TEXT internal text // END TEXT more random // START TEXT asdf …
EmpireJones
  • 358
  • 1
  • 4
  • 13
6
votes
2 answers

How To Shutdown Ubuntu Automatically X Minutes After Starting Up?

How would one automatically shutdown an ubuntu OS 30 minutes after it was turned on? Or 15 minutes after it was turned on? Etc? I tried creating an init.d script like so: shutdown -h +5 But my box does not shut down after 5 minutes.
darkAsPitch
  • 1,931
  • 4
  • 25
  • 42
5
votes
2 answers

Run script on first boot

I want to create a script that will run only on first boot, and never again. I am working on a VM that will be converted on a template so I want to make sure I can create a script that can run automatically when the server boots. I have some clues…
user3311890
  • 181
  • 2
  • 8
5
votes
2 answers

how to use powershell object properties directly without typecasting and spliting?

I have created a small script to transfer value of Active directory pc attribute called pssfulllocation from one pc to anoter pc.. To achieve this I have to use typecasting + splitting.. Here is the script which works $oldpc=read-host "Enter old…
user879
  • 267
  • 2
  • 7
  • 21
5
votes
6 answers

Execute program on remote computer using PowerShell

How can I execute a program on a remote machine using powershell?
Muhammad Hasan Khan
  • 376
  • 2
  • 7
  • 18
5
votes
3 answers

Expect script too fast: add a sleep between each line read from a file

I am trying to automate switch commands. It's almost all good, but when the expect script reads each line from the file containing my switch commands (listed line by line), the switch seems to stop after about 10 or 15 commands, i think the buffer…
2legit2quit
  • 171
  • 1
  • 2
  • 10
5
votes
2 answers

Bash commands run at terminal but not in Jenkins/Bash Script

I'm using Jenkins to build and deploy HTML documentation to a local Apache web server for our devs to use. When I run the commands in the terminal, everything installs properly (Proving the server is setup properly). However, when run the same…
5
votes
2 answers

What shebang for Anaconda Python on my directory of Server

I have anaconda python distribution in ~/anaconda/bin/python but what shebang can I use to call this version of python instead of the old one that is default on the server? # /opt/python/bin/python2.7 is the one i've been trying
O.rka
  • 161
  • 1
  • 1
  • 5
5
votes
3 answers

Can't Get PSExec to work with Powershell

Last week I developed a script that would check if psremoting was enabled on specified machines. This week I began working on a script that would enable psremoting on specified machines but I can't get psexec to run in powershell (Also, yes I know…
Delonte Johnson
  • 341
  • 2
  • 4
  • 13
5
votes
6 answers

How to test if two given files are identical?

Just updated the code... I get out everytime on the "else" sequence. You can download the update.sh file from my server. it only contains echo "Hallo update" Updated code (03.11.2015) #/bin/bash updateoldmd5=`sed -n l globalupdate.aix` …
user200271