Questions tagged [scripting]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
147 views

sql script mssql express 2008 windows 2008 server R2 x64

Scenerio:I need to run an update sql script after another scheduled task. server=Windows Server 2008 R2 x64 db = Sql Express 2008 when? - Everyday buy Sunday(i know how to do this) Why? A third party ...
5 votes
4 answers
9k views

Logging to a file, prepending a timestamp to each line (Debian)

I am trying to log output from some shell scripts of mine to a file, and I want the timestamp prepended to each line. From what I understood, that's what logger(1) is for, but I don't want the output ...
1 vote
1 answer
523 views

Diaspora server auto start when system start up in ubuntu

To start Diaspora sever, always need to cd to the /home/diaspora, then run ./script/sever My server(Ubuntu 11.10) everyday restart. I want to configure the server(Ubuntu 11.10) to allow diaspora ...
2 votes
2 answers
2k views

Simulate/script user log-ins to an Active Directory domain

We've had some login issues in our computer lab environment. When a class of 15-30 people try to log in at the beginning of class, they sometimes have to wait upwards of 20 minutes to get a desktop. ...
8 votes
4 answers
7k views

Bash: Put a job in the background and then tail the log

How do you make the escaping work so that the & is actually running the first command in the background? # foo param1 param2 >> run.out &; tail -f run.out
0 votes
1 answer
1k views

Running a script at Windows 7 or 2008 shutdown

Is there any way to run script before the computer running Windows 7 or 2008 shuts down without using local group policy editor or domain based policy? Regedit tool should be OK if possible.
0 votes
2 answers
1k views

running a linux script to check on process and if stopped how to make it start the process

We are running OES2/SuSE. The problem is with our groupwise webaccess. From time to time it stops and we just have to restart the process. The commands are: rcgrpwise status rcgrpwise start How ...
3 votes
3 answers
172 views

Direction for Scripting

I'm administering a network and they use a few scripts here. Mostly batch scripts or vbscript. It's a Windows environment, mostly Server 2008 with a few 2003 servers. My question is Should I learn ...
1 vote
2 answers
3k views

CentOS: E-mail notification of failed ssh login attempts

Under CentOS, I need a script that will run every 10 minutes and e-mail me if there are any new failed ssh login attempts in /var/log/secure.
2 votes
1 answer
3k views

How to export User Rights Assignments and import them on another machine

How would one export all of the user rights assignments from one Windows Server 2008 box and import them on another. Neither would be on a domain so this would just be local security policy.
4 votes
4 answers
3k views

How can I search IIS logs of several servers at the same time?

I need to search the logs of all the servers in the array for a particular string. Specifically, I need to determine if a given user is using OWA, EWS, or something else with our CAS servers. Is ...
1 vote
1 answer
830 views

Nagios checks for mulitple sendmail instance's mail queues

Is there an available perl script or any script for checking the mail queues of each instance of sendmail? So that we can use that on nagios nrpe, since the mailq command is only designed for one ...
3 votes
2 answers
11k views

Delete registry key via CMD script?

I'm want to edit an already production .cmd script file, to have the script delete a certain registry key in the Windows registry. Firstly, is this even possible, and secondly (if that's not possible)...
2 votes
1 answer
615 views

Remote installation script great in XP, doesn't work in Windows 7

I have a script to install an .msi file out to a list of remote workstations. Works fine going out to XP machines. I now get error code 1603 when trying to run out to Windows 7 machines. psexec -...
1 vote
2 answers
1k views

Bash script: check a list of commands

I have a bash script that launches a ps command with a list of commands like this: comando="ps -o pid,pcpu,cmd -C \"$2\"" $2 must be a variable in this form: command1 or command1 command2 command3 .....
1 vote
5 answers
132 views

Is it possible to set file permission on my apache server so that files can only be read by select users?

I would like to know if there's a way to set file permissions on my apache server so that the files can be served up by apache, but cannot be read or accessed by select users. Basically, I'm trying ...
0 votes
2 answers
120 views

How to make a bash script work on multiple account?

There are several admin-like accounts in our Linux server, different account for different purpose. Sometimes, there need multi-account co-work to finish a job. Manually, I can login and type the ...
0 votes
1 answer
1k views

Proxy+PHP: filter and process specific proxied requests and responses with PHP scripts

I need to configure a proxy on a machine A in a network X. Then I need to connect a client (smartphone) on this same network X but having the proxy configuration as the one prepared on the machine A. ...
3 votes
6 answers
4k views

How to periodically remove all content from a file without deleting it

I need to periodically empty a text file without deleting it (I know how many lines it has). I tried this: Created a cron that executes the following script other lines from the script here sed '...
2 votes
1 answer
316 views

Attaching USB device

Just wondering if anybody knows is there any script for vmware to attach or detach USB device?
3 votes
2 answers
4k views

Linux: ssh to host and use sudo to run a script, runs but part of script fails

I've searched high and low for an answer to this. I have keys setup so no password is needed for the ssh into remote host. I have sudo set up with that user so that I can run the needed commands as ...
0 votes
1 answer
25 views

Getting the current status (logged in/current program running) of OSX systems in a local network?

I'm exploring building an internal site that displays what computers in the lab are currently being used. My initial idea involved a webapp that took in info from each computer every 5-10 minutes and ...
0 votes
1 answer
163 views

Detecting when Windows installation is completed

I got the task to install Windows Server 2008 R2 inside a virtual machine (WMWare Workstation) with Powershell. It was quite easy to do the installation of Windows inside the virtual machine. Now, I ...
4 votes
7 answers
38k views

Move stored procedures from one database to another in SQL Server

I'm using SQL Server 2008, and I would like to copy stored procedures from one database to another. How?
0 votes
2 answers
357 views

Do nginx fastcgi script permissions stay with script owner or www-data (webserver user?)

Does the fastcgi permissions in nginx work like those in Apache, in which it runs with permissions of the script owner? From what I see it runs with the permissions of the web user. Can it be changed ...
3 votes
1 answer
185 views

Test file for specific permissions

I have a script where I'd like to test a file for specific permissions, specifically 0644, if it is not that then chmod it. I know I could just chmod it and let it fall through in case it already was ...
2 votes
1 answer
1k views

How to set IP Filtering under IIS6

we have a particular application under a virtual directory that is used for administatrive purposes. In order to protect the application, we have IP filtering enabled where we specify a list of ...
0 votes
1 answer
314 views

Running root script upon ssh'ing as a particular user, but not upon standard login

I would like to do the following : If I login as user ABC via the login screen, do nothing. However if I ssh as ABC, then I want to run a root script, without being prompted for roots password, and ...
0 votes
3 answers
7k views

Batch File Syntax to get files from FTP server

I have trouble getting all files from an FTP Server. Usually I get all files using the command line/terminal with syntax the following syntax: get a.txt (very, very time wasting with login ...
3 votes
6 answers
18k views

Access to the current time in windows batch script

I need access to the current time from within a batch script. When typing time in the cmd, I get something like this: The current time is: 16:58:03.98 Enter the new time: What I need is not that but ...
0 votes
2 answers
3k views

What are the best practices to manage UPS in windows 2008 R2?

with win2k3 i used the ups service to monitor usb connected UPS and launch scripts when ups meets critical battery condition. The ups service is no more available in win2k8 and power management seems ...
3 votes
2 answers
98 views

what type of scripting is this and is it suggested for my environment? [closed]

First of all, I hope I am not duplicating another post. If so I will delete immediatly. I have gone through many of the questions/answers on this website trying to find what scripting language I ...
3 votes
1 answer
596 views

How to get client to update GPO to recognized scripts were added in manually

So I'm attempting to programmatically add a logon/logoff/etc script to be ran with a GPO. I add the scripts in their respective /Sysvol/blah... directory. I update the scripts.ini file correctly to ...
3 votes
7 answers
49k views

Batch file to MASS ping group of computers on network by name, check reply, and resolve hostname

So, I have a list of 5000 computers on my Windows Active Directory network that may or may not still exist (I know, don't ask...I need to know for a project, and of course little help from the network ...
2 votes
1 answer
2k views

Keeping a Python Script alive after leaving SSH Client?

I have a while loop in my Python Script and its independent script so I can't run it as a daemon. Also I have tryed using nohup, but I'm having this error: root@ubuntu:~/Desktop/starthere-group-ok# ...
0 votes
1 answer
156 views

bind shell program to user as root

I have an embedded system I have been developing. I would like to bind a program called HHPConfig, which I wrote and needs root permissions for setting network interfaces, rebooting etc..., to a user, ...
0 votes
1 answer
3k views

Nginx upstream based on remote_addr

Do you have any idea if there is any easier solution to pass the requests to different upstreams based on the visitor's ip address? The only solution that I found at the moment is: upstream live { ...
0 votes
1 answer
77 views

Moving spam from filter to mail server

I was wondering if its possible to take messages quarantined by a Spamassassin box and move it to the users spam folder residing on an email server. In my case I would want to move mail from an ...
0 votes
1 answer
92 views

Can I turn off Office Auto Save feature using ARD?

I have around 300 OSX desktops, and I'm not looking forward to having to walk around to each one to turn off MS autosave, can this be done using Apple Remote Desktop and a script?
0 votes
2 answers
2k views

mkdir: cannot create directory `../abc/2011-11-23: No such file or directory

I have got a sftp script that downloads the archives , unzip it and then rename the files according to date and moves it to respective folder. I had to move the script from USB drive onto a separate ...
0 votes
1 answer
824 views

Query Exchange 2007 remotely for a user(s) mailbox size, and quota

Currently I'm using this powershell command on the server in the Exchange Management Shell: Get-MailboxStatistics username | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –...
0 votes
1 answer
132 views

Postfix : Open relay to script

What I want to do with postfix is have an open relay that accepts all emails. I then want it to push all the received emails to a script. I have found solutions, but they never specifiy on how to do ...
2 votes
0 answers
1k views

Controlling rdp listener connections from command line

RPD on my windows 2003 server sometimes becomes incapable to accept connections. But netstat shows that port is listened. c:\> netstat -ano | find "3389" TCP 192.168.1.1:3389 0.0.0.0:0 ...
0 votes
1 answer
295 views

Setting metrics in ubuntu for eth0 and wlan2

I have two scripts, one copying files from machines on closed network (no internet) to the hard drive of the laptop and the other script trying send these files to over the internet using the wlan. ...
0 votes
3 answers
166 views

Using SSH to find access to a problematic script in logs of multiple domains

I run several (~20) sites on a Dreamhost VPS. Lately I max my memory allocation for the VPS and I want to find the problem. I would like to have an SSH script that will scan all the log files of all ...
1 vote
2 answers
1k views

rsync shell script with input

I would like to have a rsync shell script that the user will enter the folder or file to sync to another server. i.e. - ./deploy /html/ or ./deploy /html/kuky.txt the script will wait for the input ...
-3 votes
2 answers
141 views

Automate root ssh scripts [closed]

We require to be able to run some script as root from nothing other than an SSH login. IE, we have root and password, and we need to perform a script action on a bunch of servers.
0 votes
1 answer
395 views

Scripted install of Debian backdoor/rootkit [closed]

We have a number of servers (100+) that we need to increase a certain type of security on. (sortof internal, sorry NDA). We have thought about using a rootkit of some sort that would be able to keep ...
2 votes
2 answers
777 views

Schedule Task run Without Being Logged in

I have seen similar threads here and on the net, but I think my question is slightly different than what I can find... I have a script that runs perfectly when logged in with a service account I ...
0 votes
1 answer
299 views

How to execute the "while" statement after fetchmail do his job?

I have this script inside /etc/ppp/ip-up.d/script #!/bin/sh /usr/sbin/postqueue -c /etc/postfix -f /usr/bin/fetchmail -v -f /etc/fetchmailrc -L /var/log/fetchmail.log while ! postqueue -p | grep -q ...

1
25 26
27
28 29
37