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
5
votes
2 answers

bc: using "scale" with bash variable

Easily, I'm writing a script that needs some values with 2 digits after floating point. Trying to use bc I don't understand how use "scale", i.e. A=12 ; bc <<< $(($A/5)) it's correct, but adding "scale" leads to an error: A=12 ; bc <<<…
watchmansky
  • 769
  • 4
  • 10
  • 17
5
votes
7 answers

How to 'echo "" > x' on multiple files

What is the best way how to empty a bunch of files in bash? As far I've been doing this echo "" > development.log echo "" > production.log I don't really want to delete those files, so rm is not possible. I've tried many things like echo "" >…
Jakub Arnold
  • 1,744
  • 10
  • 26
  • 33
5
votes
5 answers

Ola Hallengren's SQL Backup to Network Location not working

I have set up Ola Hallengren's SQL Server Maintenance Solution on several SQL Express servers (2008 to 2012 R2) in the past few years. I recently have started having issues with the network backup component on all of them a new one. I've had this…
MagnaVis
  • 388
  • 1
  • 4
  • 13
5
votes
3 answers

How do I launch a command on a remote computer with an invalid domain trust? (using local creds)

I intend to use WMIC to reset the trust of a machine that is remote, and off the network. All of the following variations result in an "access denied": The following works fine: net use \\patterson-e10 /user:patterson-e10\wks.admin xxx All the…
makerofthings7
  • 8,911
  • 34
  • 121
  • 197
5
votes
1 answer

Including a bat file in a bat file

I have many bat files that share a common setup of variables. Instead of defining the same variables over and over again (and making errors in the process) I would like to include one bat file in all the others. How do I do this? Excuse my newbie…
raoulsson
  • 4,763
  • 10
  • 34
  • 29
5
votes
2 answers

OK to modify HKLM\Software\Policies and HKCU\SOFTWARE\Policies on a domain?

Background: I have a domain (2003 Functional Level) with a mix of Windows XP and Windows 7 clients. We have been using Group Policy to manage our workstations. Now, I am in a situation I need to apply different GPO Policies (not Preferences) based…
5
votes
2 answers

Is there a way to script the installation of System Center Configuration Manager updates listed in Software Center?

We have a very tight outage window and for many of our systems, the servers must be rebooted in the correct order. Because of this, I would like to script our updates. I have attempted to use this Powershell script found in the Microsoft Script…
5
votes
1 answer

Assign Static MAC address to VM Hyperv

I have a scenario that involves building out a ton of virtual machines in Hyper-V, I cannot use SCVMM and must use a scripted method to create these VMs. I have a CSV with all required information filled out so my Create-VM code works and creates…
nGX
  • 344
  • 1
  • 6
  • 19
5
votes
3 answers

Linux command to find and delete certain files, but output the result or verbose mode?

So I use these command on my storage server to clean up some junk, but it doesn't produce any output or result. I found the syntax online somewhere and just modified for which files I need it. What else do I need to add to see what is actually being…
user1781482
  • 151
  • 1
  • 1
  • 3
5
votes
4 answers

Is there a chroot build script somewhere?

I am about to develop a little script to gather information for a chroot-jail. In my case this looks (at the first glance) pretty simple: The application has a clean rpm-install and did install almost all files into a sub-directory of /opt. My idea…
Nils
  • 7,695
  • 3
  • 34
  • 73
5
votes
1 answer

Cacti graph not showing

I have created php script for cacti which outputs data in format like: : Output of my script: temperature:20 humidity:15 Then I created data input method where input string is: php /scripts/getTempHumData.php…
5
votes
1 answer

How can I use SetUID on a shell script to run as a non-root user?

Our company's server is running Ubuntu 12.04 (Precise) and Apache 2. We have a custom, internal web application installed. I have a bash script which pulls any updates to that app from source control to the server. Only one user on the system (the…
Jazz
  • 153
  • 1
  • 4
5
votes
3 answers

Thunderbird - Login Script to create user and email account

Is there anything out there that will let me script via active directory and login scripts the creation of a thunderbird user profile and associated email account? I looked to do this in Outlook 2010, however due to outlooks current slow preformance…
Kristiaan
  • 442
  • 1
  • 9
  • 22
5
votes
4 answers

How to script printer creation on a Windows Server 2008 R2 clustered print server?

As per subject. I've found some ways of scripting printer creation on Windows print servers using WMI, but it looks like WMI doesn't support clustered print servers (or clustered servers at all). The scripts in…
Massimo
  • 70,200
  • 57
  • 200
  • 323
5
votes
1 answer

Amazon EC2 notifying the instance when the autoscale service terminates it

I am in need of knowing when an instance is supposed to be shutdown by the autoscale, as I want the instances to register themselves and deregister themselves from a given service. I know that the autoscale can start/stop any instance any time so I…
Ano
  • 51
  • 3