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

learn more… | top users | synonyms (2)

4
votes
4answers
332 views

How can I run arbitrarily complex command using sudo over ssh?

I have a system that I can only log in to under my username (myuser), but I need to run commands as other user (scriptuser). So far, I have come up with the following to run the commands I need: ssh ...
0
votes
2answers
30 views

Bash Script keeps respawning after it should die

#!/bin/bash PID=$(pidof daemon) kill $PID while ps -e | grep "[d]aemon" >> /dev/null; do sleep 30 done sh -c /root/daemon This script is set on a cronjob to kill and restart this program. It ...
-2
votes
0answers
13 views

Killing Oracle frmweb processes with no jobs - with bash

I am looking for a script that will allow me to find frmweb processes that do not have any jobs and kill them. A few places, including superuser, have recommended monit, but that doesn't seem to be an ...
-1
votes
0answers
19 views

Is it possible to script 'duplicate display on 2 & 3' in Windows 7? [migrated]

We have about 300 computers that have three displays connected to them: One DVI, one DisplayLink USB/DVI, and and HDMI projector. We would like to duplicate 2 & 3 (USB & HDMI). Windows Key + P ...
1
vote
2answers
60 views

script to count the occurence of the particular string in the given time interval

We are trying to write a script "sendemail.sh" to count the number of occurrence of a particular string in a log file "SendEmail.log" within the given interval. We have a log file. In that we are ...
0
votes
2answers
50 views

Exception calling “UploadFile” with “2” argument(s): “The Content-Type header cannot be set to a multipart type for this request.” [duplicate]

I am working with a script that is supposed to first check if a PC is alive then FTP a file to a server. However, when running the script I am getting the following error: Exception calling ...
1
vote
1answer
136 views

Looking for a powershell script that can pull a file from a set of PC's and FTP

I'm looking to write a script (preferably powershell) that will essentially copy a file from a bunch of PC's and FTP it to a server. So the structure of the environment is that we have a file on ...
0
votes
2answers
35 views

Can I use rsync to create a list of only changed files?

I am using rsync in a bash script to keep files in sync between a few servers and a NAS. One issue I have run into is trying to generate a list of the files that have changed from the during the ...
-2
votes
1answer
62 views

powershell script that outputs date of the day as a file name

I have a script which lists local admins of all hosts in Active Directory below: $Searcher = New-Object DirectoryServices.DirectorySearcher([ADSI]"") $Searcher.Filter = "(objectClass=computer)" ...
0
votes
1answer
59 views

Why does this command to send emails work from the shell but not as a cron job?

I have a problem with cron jobs, I need to send email notification to users, I use this command curl "http://example.com/index.php?option=com_community&task=cron">/dev/null 2>&1 When ...
0
votes
1answer
26 views

Detect which scripts are using old interpreters

I have a few Debian machines with some nearly-orphaned script interpreters, for example /bin/bash3 and /usr/bin/perl510. How can I detect those scripts that still have the aforementioned interpreters ...
2
votes
1answer
105 views

Server Reboot Script - No Credentials

I'm looking at running a script to reboot a Windows 2012 server nightly, and all the guides seem to be for using scheduled tasks. As far as I know though, a change in the admin credentials will break ...
0
votes
1answer
55 views

Automate app pool recycling of an Azure Cloud Service Web Role

How can I script (e.g. using PowerShell) the action to recycle the app pool of a web site hosted in a Web Role on Azure Cloud Services? Only one instance of the cloud service is running (used for ...
0
votes
1answer
32 views

Rebuilding MS Agent Jobs from MSDB table

This morning our DB server died. They restored backups to another server but these didn't include the many MS Agent jobs. Anyway I have managed to get a backup of the old MSDB table where all the ...
0
votes
1answer
34 views

Find Users without a password in UNIX AIX

I'm searching for a script that finds users who don't have a password. Could anybody please explain me the commands that are needed in such a script?
0
votes
1answer
57 views

Screensaver startup script (batch or reg) GPO, silent install

I have an application, which after it disconnects from a VPN connection, resets the screensaver settings. What I'd like to do is create a GPO script or batch file to run every time the user logs into ...
1
vote
2answers
70 views

AD Group and Distribution Group with O365

I have a O365 with Exchange, and a local AD. I want to manage distribution groups and distribution groups members via PS scripts (that will run by scheduled task), that look users' AD attributes ...
-2
votes
1answer
32 views

how to write a script to get ifInOctets and ifOutOctets? [closed]

Can any one help me with writing a script to get ifInOctets and ifOutOctets from a server 10.38.2.24 ? I need help
0
votes
1answer
42 views

VBscript - returning the path & size of a file

I would like to add a piece of code to SYDI that would return me the location & size of a specific file. For example, a server "X" has a DB file(s) & path like this: ...
2
votes
2answers
190 views

How to split logs according to patterns?

I would like to be able to split log files according to a pattern found in them. For example process all logs and look for /(\w+)\s to match /myresource but exclude /myresource/anythingelse, to ...
2
votes
2answers
33 views

Detecting in a script whether apache2 root is /var/www or /var/www/html

Apache2 recently changed the default root directory from /var/www to /var/www/html, which breaks the scripts I distribute for installing some software I wrote. Is there a reliable way of detecting ...
0
votes
0answers
13 views

How do I manage multiple application instance setup/teardown via URL?

We have a heavily developed web application, with a pretty sizable team, and a lot of things going on in many branches at the same time. For our approval process, after we've done our own continuous ...
2
votes
1answer
166 views

Bash script match grep output and send message

I am developing a script for monit status checking so I can send OK status messages to NagiOS NSCA server (passive checks). The problem I am having is that my bash script still sends messages if the ...
0
votes
0answers
41 views

Trying to create a pre-revprop-change for editing message on commit

I'm trying to add a hook to svn so that you can edit messages on commits. But whatever I do I get the same error message. Revprop change blocked by pre-revprop-change hook (exit code 255) with ...
0
votes
0answers
15 views

SQL Server Express Application Deployment Via CD

Our company has an ancient home-grown Win-32 application which uses a SQL Server Express db. We have a salesperson at a remote office who has no reliable internet and I need a way to package this app ...
0
votes
1answer
52 views

Bash — Using a character-based graphical utility to store output

I'm using bash to script a remote dialing program in an Ubuntu(14.04) server and I am having some significant trouble trying to read the output from it. I would like the program to execute as I would ...
0
votes
1answer
55 views

Finding valid email service providers in a large list of domains

I have a list of approximately 13K free email/webmail providers from circa 2000. Obviously the vast majority of these services have gone out of business, and the domains have either lapsed, or been ...
-1
votes
2answers
63 views

Server 2008 R2 - Script to kill idle sessions over [closed]

Looking for a script that can end idle session shares on a Server 2008 R2. If sessions are left open for too long there are programs that fail to update due to files/folders being open. I am looking ...
0
votes
2answers
129 views

Copy-item FileSystem provider error

Copy-item cmdlet is not working as expected, i don't understand why. This is my code : $Source = "C:\folder1" $Destination = "\\172.22.0.115\c$\folder2\" $Password = ConvertTo-SecureString ...
0
votes
1answer
19 views

How to catch system events when a program is being updated and robotize routine steps when you update software?

I'm a support engineer for an accounting program. The program runs under Windows. I have to update many of this accounting software bases daily. I mean the software is always the same. But users may ...
0
votes
0answers
46 views

Powershell deploment script into multiple 2003 windows servers

I have created a script "test.ps1" that runs security checks on folders within machines. Now I want to deploy this script into 70 windows servers so it can run these security checks on all of them. ...
4
votes
3answers
97 views

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 ...
0
votes
0answers
64 views

Can't figure out how to get started with powerdns-recursor lua scripting

I have a server (Ubuntu 12.04) where I run powerdns-recursor. I'm trying to add some logic to certain requests and have got my target set on lua scripting for powerdns. I don't seem to be able to ...
3
votes
3answers
278 views

Year Month day from file name in shell script

I hava file names like below adn_DF9D_20140515_0001.log adn_DF9D_20140515_0002.log adn_DF9D_20140515_0003.log adn_DF9D_20140515_0004.log adn_DF9D_20140515_0005.log adn_DF9D_20140515_0006.log ...
1
vote
1answer
65 views

Need to get a list of all users within a subnet of servers

I am looking to write a batch or vbs script to gather all users (local to the server. ie. administrators or a local account(not ad users)) on a collection of servers inside my network. I assume I ...
0
votes
1answer
33 views

virtual web folder served by PHP script

I am trying to configure my apache to be able to display (virtual) pages like: mywebpage.com/something1 mywebpage.com/something2 mywebpage.com/folder/something3 I would like these "somethingX" and ...
0
votes
1answer
87 views

Bash if statement equal output from last command

I am trying to equal something from last command with bash if statement: #!/bin/bash monit status if [ "status" != "error" ]; then echo -e "hostname\ttest\t0\t0" | /usr/sbin/send_nsca -H ...
1
vote
1answer
59 views

CGI Script not running in PHP file

I have a CGI script in the server called script.cgi and I have added the following code to the domain vhost: Action add-footer /cgi-bin/script.cgi AddHandler add-footer .htm .html I have ...
0
votes
0answers
78 views

OpenVPN - pushing script to client upon connect

Is it possible to have an OpenVPN server push scripts out to clients upon tunnel establishment? I need to set up specific iptables rules on my Linux clients and would like to be able to deploy the ...
1
vote
1answer
61 views

Using VBscript and EnumNetworkDrives, how can I instruct our login script to NOT delete a drive letter mapping and remove the rest upon each login?

I've been working on adding some new parts to an already existing login script using VBscript. I'd like to use the below code to erase all drive mappings on login. Set WshNetwork = ...
0
votes
3answers
48 views

tail -f AND allow text input

I want to create a script that allows some interactivity by tail -f logfile from myService allows text to be entered and sent to myService What I could not solve yet is this two functions working ...
2
votes
2answers
104 views

simple script to backup PostgreSQL database

Hello I write simple batch script to backup postgeSQL databases, but I find one strange problem whether the pg_dump command can specify a password? There is batch script: REM script to backup ...
0
votes
1answer
120 views

Kill child process when the parent exits

I'm preparing a script for Docker, which allows only one top-level process, which should receive the signals so we can stop it. Therefore, I'm having a script like this: one application writes to ...
1
vote
1answer
59 views

Email administrator when a duplicate IP is found on the network

It was suggested that I ask this question on serverfault. I know this is a bit of a custom requirement but I was hoping someone currently has (or can put together) a script that checks for duplicate ...
-1
votes
3answers
403 views

How to change default install path for Notepad++ in Powershell silent/unattended script

I cant figure out the parameter(s) to change the default install path C:\Program Files\ of Notepad++ to the drive I want it to install to when I run my PowerShell script. I am trying to do a silent ...
-1
votes
1answer
57 views

RSYNC only listing files when run from bash script

I am trying to copy backup files of my companies mail server to our backup server via RSYNC. I use this same script for backing up our web hosting server backup files with no issues. When I type ...
1
vote
1answer
388 views

Comparing 2 CSV files in powershell exporting difference to another file

I've write this script out, and could have swore I had it giving me a Failed early this morning but now I'm getting nothing and not sure why. Basically I need to compare $SourceAddress with ...
0
votes
1answer
81 views

Powershell pipe exporting to csv is loosing data

I'm trying to write a script that will take input from a .txt file of IP address. Do a reverse DNS lookup to get the hostname of the IP address and then export that data into .csv file. Here is what ...
3
votes
3answers
132 views

Update a network driver through GPO/AD

Our organization has just deployed new computers with Windows 8.1. Roughly 50 of them. We've run into an issue with the driver on the new computers which is flooding the network with ipv6/multicast ...
1
vote
0answers
90 views

Linux Script to login to Raspberry pi and run some scripts inside raspberry pi [closed]

This is my scenario, We have some sensors on different sites, these sensors are connected with some equipment having SIM cards in it to allow the internet connection. On the other hand, we have a ...