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)

2
votes
3answers
459 views

Bash script: Monitor hotfolder and partial files

I have a customer that upload files through FTP, I made a script that basically monitor the ftp folder and move the file on a production machine. How can I check if the file has been completely ...
0
votes
1answer
455 views

Powershell script to insert SQL Statement with a apostrophe error

I have the following part of a script that takes objects form Exchange and AD and inserts into a MYSQL table. But some of the Full Names variables have a ' like the distribution group PA's. Here's ...
1
vote
3answers
936 views

gpg-agent says agent exists, but gpg says agent doesn't exist?

I'm struggling with some issues while scripting gpg with bash on a Debian 6.0.6 box. I have a script that does a batch of operations and wants to make sure that a gpg-agent is available before it ...
0
votes
2answers
1k views

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 ...
2
votes
3answers
1k views

Upstart script vs. command-line: why this difference in behavior?

I'm trying to set up Tomcat to start with upstart. I find the following works: description "Tomcat Server" start on runlevel [2345] stop on runlevel [!2345] respawn respawn limit 10 5 ...
1
vote
2answers
261 views

change user within bash script

I have a simple bash script which runs great as a regular user. When launched from postfix, it runs as nobody:nobody which prevents many commands from working. Is it possible for the script to ...
1
vote
2answers
317 views

How do I write a powershell script to install RDS-RD-Server role?

I assumed I would just put the following in a filename.ps1 named file and run it like: powershell.exe -noexit 'filename.ps1' It runs, but it's not doing anything. Inside the filename.ps1 I have ...
1
vote
0answers
267 views

SSMS stuck scripting database objects

SQL Server Management Studio sits stuck, after scripting all objects in a database. Except it didn't script all objects in a database. i scripted all the objects in an SQL Server 2008 database from ...
0
votes
1answer
73 views

Manipulating Launchd from Python?

I have a simple python script for manipulating a plist file. Once this file is updated, I'd like to have that same script unload and then load that plist file in launchd. Normally, I'd use launchctl ...
0
votes
2answers
965 views

Good pratice to create script to start/stop/restart service?

I was wondering what is a good pratice to create a good script to start/stop/restart some service. I will try to make myself more clear, ok ? Nowadays, I do something like this: let's say I would like ...
-1
votes
2answers
71 views

Mass create txt file in each folder [closed]

I have a directory with a bunch of folders and I want to create a text file for each folder containing this string: Visit http://www.example.com. How can I do this with windows cmd?
0
votes
1answer
88 views

One-liner to retrieve external IP address [duplicate]

Possible Duplicate: Finding the Public IP address in a shell script For use in scripting, it would be handy to be able to do this: IP=`....something ....` echo ...$IP... >> ...
-2
votes
1answer
92 views

Adjusting output of tail -f on website log [closed]

I am real-time monitoring my website logs with tail -f, but I am having trouble getting just the following to show in the results in this order: Host Name - IP Address - Page - Date & Time This ...
0
votes
2answers
347 views

Powershell changing Date to the first of last month when the script runs [duplicate]

If I run the script on 2/4/2013or any other day in February I want the date to be change to 1/1/2013. I am replacing date on line 59 with this value. #Get the content of the CMS Script. $CMSReport = ...
1
vote
1answer
917 views

replacing a line or date in a text file using powershell

I am trying insert today's date on a text file at line 59. How do i do this? Line 59 has like 30 spaces and then reads like this. After the PowerShell script runs it will change the date so it has to ...
0
votes
1answer
125 views

Is there a way to create a mail enabled contact from a script in Exchange 2003?

I've seen the newer cmdlets for 2010+ in Exchange, but it looks like the only way to do things in 2003 Exchange is through the management console. Is there anyway to make contacts from a script?
0
votes
1answer
32 views

Omnibus uniform Chef version install across platforms

So I'm looking for a uniform way to install chef on a number of different servers running different platforms. I know I can use the omnibus installer for this, but I also need a way to lock or ...
0
votes
1answer
618 views

Export hardware specifications to a spreadsheet for Windows Server

I have a bunch of servers : Windows 2003 and 2008. I just wanted to export these hardware specs to a spreadsheet: cpus : num processors, clock speed, etc total hard disk space total used disk space ...
0
votes
1answer
106 views

openvpn client - dynamic server/proxy ip

We're running an openvpn server and let some clients connect to the vpn server through a socks proxy. This already works. Our problem is now, that we need to change the ip address of our proxy ...
0
votes
1answer
72 views

What is the easiest way to obtain a script-driven hot failover system?

I need to reconfigure a prod env to provide hot failover for a db driven web app written in Perl that is currently running on an Apache HTTPD server, on a Linux OS. The app is not designed to run in ...
2
votes
1answer
723 views

Powershell VMWare Script not running from Scheduled Task

Background / Goal I am attempting to create a scheduled task that will: Run at the specified time (once) Run a PowerShell script that: Logs all of its output as a transcript Connects to my vCenter ...
0
votes
1answer
238 views

powershell script to move backup files

I want to zip sql bakup files and move from one directory to to another directory within a system using powershell 1.0 can you help me since am a beginner
2
votes
3answers
607 views

Recursively move thousands of files into subfolders windows

I have a Windows Server with >300,000 images in a single folder. I am feeling a performance hit on the filesystem and I would like to move them into subfolders as has been suggested by many others. ...
1
vote
1answer
112 views

Automation Methods - Templates or Scripting

Background We setup very large systems which consist of many different types of servers, switches, and routers. These systems are then shipped out to different locations and are turned on ready to ...
-3
votes
3answers
2k views

How to find files of certain extension and tar each of them in to another location

I have script for finding files of certain type and compress them to a single tar archive and put in to other place. But now, there is a change in requirement, that I need to find files of certain ...
0
votes
1answer
193 views

Powershell error when adding filepath

The script looks like this: $searchOU='ou=Servers,dc=mydomain,dc=NET' Get-ADComputer -filter * -SearchBase $searchOU | Foreach-Object { $server = $_.Name ...
2
votes
0answers
125 views

Login script on windows client does not map drives correctly

This script is located in the OU container of a sample Organization tree in an eDirectory that I created for the purpose of exploring and troubleshooting. This is not a critical/ live system setup. ...
1
vote
1answer
76 views

Generic script to print files of various types in Windows

Is there a command or script in Windows to print a file (various file types such as .doc .xls .txt .pdf) to the default printer? As far as I know one usually has to execute the relevant application ...
0
votes
2answers
255 views

How can i get the total records in my DNS Server

I'll need to count all the records in a dns server 2008, for all the zones configured on the server, by running a script locally Thanks, aca
0
votes
1answer
114 views

How to differentiate between start/stop/status in upstart

upstart has post-start, post-stop, etc... and script. as i understood, the script part gets executed on initctl start X or initctl stop X or initctl status X. so how do i know in script which one ...
3
votes
1answer
153 views

echo $? doesn't work when executed remotely

When I execute a command as below it gives me an output as expected but when I run the same command on remote server it always gives me echo $? as 0. locally # <some command> # echo $? ...
1
vote
1answer
79 views

FOR works at prompt, but not in script file?

As part of a task that I am working on for a customer, I need to make some modifications to the enterprise logon script. Windows command-line is definitely not my area of expertise, but I am doing OK ...
0
votes
1answer
714 views

How do I delete a remote file using NCFTP (Windows client)?

With ncftpput.exe how do I delete a remote file once logged in? I have tried using the -W option to send a Raw FTP command but cannot get it to work. Has anyone got a working example? Have tried ...
2
votes
1answer
2k views

How to Extract command-line output into a Variable?

As part of a task that I am working on for a customer, I need to make some modifications to the enterprise logon script. Windows command-line is definitely not my area of expertise, but I am doing OK ...
1
vote
2answers
509 views

How can you add a command line test to Jenkins that reads the exit code?

I want to add a command line script to Jenkins as part of the build process. This command line script will exit with an error code of 0 if things where successful or 666 if it fails. I wish to stop ...
1
vote
6answers
898 views

freebsd creating a script to check if service is active and start the service if not

Here's the deal: I'm running a freebsd webserver with apache solr on a jetty every now and then ( few times a month ) jetty quits and I have to restart it by typing: service jetty start I'm kinda ...
0
votes
2answers
259 views

Ubuntu unattended upgrades to run at a certain time

I'm trying to work out the best way to run unattended upgrades every Thursday at 3am but can only see a way to run this weekly but not a given time. I thought of one way would be to have a script ...
2
votes
2answers
356 views

Running a script containing find with a regexp fails in cron but works in a shell

I have the following script in my /etc/cron.d: 19 15 * * * root /opt/scripts/clean-nexus-release-repo.sh The clean-nexus-release-repo.sh script looks like this: #!/bin/bash find ...
0
votes
1answer
147 views

Crontab start a screen

I started a screen by shell script in crontab, when I entered the screen, the left side became "sh-4.1#". While I runed the script directly, it was nomal with "[root@localhost data]". What happened? ...
2
votes
1answer
1k views

How to retrieve the current Windows NLA network location from command-line?

We have a Windows Server 2008 R2 domain controller which always sets its NLA location to 'Network 3' after a reboot. Without fail, this defaults to Public, which screws with my Domain profile ...
0
votes
2answers
115 views

Script to check server for WordPress installs and report version information [closed]

I'm looking for a script that can be run on a linux server that will find all WordPress installs and report their versions, or report if a version is out of date. I've googled for something and it ...
1
vote
2answers
77 views

Download with the bash or Python while keeping the directory tree/structure

I have a list of files that I need to download such as www.domain.com/files/archive.zip www.domain.com/img/icon.ico www.domain.com/files/backup/archive.zip www.domain.com/backup/img/icon.ico ...
1
vote
1answer
331 views

Accessing Workgroup Shared Folder from Domain

I have a domain and a workgroup. My users are supposed to upload files on regular basis to several shared folders on the workgroup. I have difficulty accessing the workgroup shared folders without ...
2
votes
1answer
570 views

Mirror directory, only purging files in destination directory older than 7 days

I would like to mirror a directory, but only delete files in the destination directory older than 7 days. Situation: - Directory A is mirrored to Directory B. - A file from Directory A is deleted ...
-1
votes
1answer
213 views

shell script - while loop, handle the exception

I am running a shell script with a while loop and it exits with the below error, how could I avoid it or catch the error and let the loop to continue ? ie how could I handle the exception stty: ...
0
votes
1answer
167 views

is it possible to provide variable arguments to xinetd service?

I have created a bash script to listen on specific port (using xinetd), so whenever there is someone connecting to port, then it invokes the script and provides its output to user. But i need to ...
3
votes
1answer
423 views

How can I automatically delete /tmp folder on shared drive?

We have a /tmp folder that people use for temporary stuff. It can be anything and any file. We want to make it so that this automatically deletes (or preferably MOVES to another folder on the same ...
-3
votes
1answer
344 views

Which scripting language to use to asynchronously ssh into equipment, run several commands, parse the output, and save to a file on my computer? [closed]

There are several points I'd like to stress in my question. I'd like to login by asynchronously ssh'ing into our infrastructure equipment. Meaning, I do not want to connect to only one device, do ...
1
vote
0answers
94 views

Windows file compare (FC) spurious differences

I'm getting differences like this: a.txt Betty Davis Cathy Edwards b.txt Betty Davis Cathy Edwards There are only two lines listed in the diff (which doesn't ...
8
votes
2answers
534 views

Using Diskpart in a PowerShell script won't allow script to reuse drive letter

I built a script that mounts (attach) a VHD using Diskpart, cleans out some system files and then unmounts (detach) it. It uses a foreach loop and is suppose to clean multiple VHD using the same ...