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
5k views

Script to wrap around an application and wait for app to finish

I need a vb script that will wrap around an applcation which will stay open until the application finishes. I want to be able to call the following command "setup.exe /qb /I Autocad2010.ini /...
JohnyV's user avatar
  • 938
1 vote
7 answers
33k views

init.d script not working .... but the command works if I execute it in the console

I have a command that is working fine if I executed it from the command line ... but when I put it in an init.d script it wont's start (well .. it starts but have a behavior different from that when ...
massi's user avatar
  • 113
0 votes
1 answer
49 views

best practice for similar linked tasks?

I'm setting up a server for a small office, that is accessable from the internet. Since our ISP has a transparent proxy, most dynamic dns services fail, other than dyndns (who isn't our provider) so ...
Journeyman Geek's user avatar
19 votes
8 answers
2k views

How do I become a scripting guy? [closed]

I am a fairly new Windows Systems Administrator. I have done some basic batch files and some other scripting. I would like to know what path I should take to become a better scripter. What language ...
user36440's user avatar
  • 325
3 votes
2 answers
1k views

How to power off a hard drive to essentially "hot swap"

I'm looking for either freeware or the programming basics to power off/on a hard drive. Mounting and unmounting a hard drive is simple enough just using the command prompt in Windows XP. Now I need ...
user avatar
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 ...
Webs's user avatar
  • 396
0 votes
3 answers
7k views

How to script sql server 2005 database with data?

I use sql server 2005 as my database for my web application.... I generated scripts of the database by, Database->Right Click->Tasks->Generate Scripts I can script all my Tables,Stored ...
ACP's user avatar
  • 149
1 vote
1 answer
2k views

Sharepoint 3.0 and Script to Extract files

We have a sharepoint server that we are looking to script an extraction on a partial site. The request is that they have a site that that can have multiple sub-folders. The file will then be ...
Adam M.'s user avatar
  • 55
0 votes
3 answers
13k views

Force admin$ share and C$ share across the network as well as simple file sharing turned off

I am trying to get Symantec Endpoint Protection working (trial). I have succeeded but found that on the windows xp machines I need to turn off simple file sharing and share admin$ and c$ as admin ...
JohnyV's user avatar
  • 938
1 vote
1 answer
214 views

SBS 2008 Script to connect - disconnect backup disk?

I want to be able to leave multiple external drives connected to an SBS 2008 server and select which drive is used as a target for the backup without physically connecting/disconnecting the drive. ...
Ed Fries's user avatar
  • 1,619
2 votes
2 answers
2k views

Powershell script to pull users from an ad group and create folder with permissions

I saw a question that was similar however the answer they got was in vbscript. (PowerShell/Command Prompt - Create folders from AD group members) I need to create a series of folders based on the ...
JohnyV's user avatar
  • 938
4 votes
4 answers
7k views

Need a way to run a script on windows boot up prior to a user logging in

I need to run a custom script which runs when Windows boots up.I know its possible to run it when a user logs in but I want to run it when the system reboots i.e. prior to a user logging in. The OS in ...
Sharjeel's user avatar
  • 347
0 votes
1 answer
132 views

Is there a machine readable list/feed of Microsoft update files?

Is there such a thing as a machine readable (csv, xml) list of all available updates and download locations for Microsoft products such as Windows Server 2xxx? Basically, I would like a version of ...
kdt's user avatar
  • 1,410
6 votes
2 answers
3k views

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 ...
darkAsPitch's user avatar
  • 1,941
1 vote
1 answer
457 views

Redirecting to a diferent exe for download based on user agent

I own a Linux-Apache site where I host exe files for download. Now, when a user clicks this link to my site (published on another site): http://mysite.com/downloads/file.exe I need to dynamically ...
Ra.'s user avatar
  • 217
1 vote
3 answers
4k views

Script to restart BlackBerry services

Can somebody give me a script advice/example of how to restart services? I have to restart 17 services, but the first 4 services have to be in the right order and after the restart command is given ...
ICTdesk.net's user avatar
  • 1,183
2 votes
1 answer
3k views

Start a VPN session using a Terminal script

I use an OSX Terminal session to start a VPN connection. The command that I execute at the prompt is: /etc/netlock/cvc -c :: This works as expected. I would like to save this to a script file that ...
craibuc's user avatar
  • 467
0 votes
2 answers
5k views

getting the last two tokens in batch script for command

I have a file name with fullpath and want to get the filename and the parent directory of the file.How can I parse this in batchscript? e.g for /f "tokens=4,5 delims=\" %%a in ("F:\mydata\WebLogs\...
Sen's user avatar
  • 15
2 votes
2 answers
70 views

Disabling scripting on login

We recently discovered that an employee of our client was able to execute a "script" that prevented other users from logging into the server. This is a Windows Server 2003 box and employees connect ...
modernzombie's user avatar
2 votes
2 answers
417 views

MSSQL access from Perl

I've been tasked with writing a script to do some file processing, and I need to be able to do a simple query against a SQL server to verify the counts on the server match up to how many the database ...
Zypher's user avatar
  • 37.6k
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?
user avatar
0 votes
2 answers
1k views

Bourne Shell Array

I'm looking to write a bourne shell which loops through an array of hosts and performs an rsync for each. Something like: HOSTS=("host1.domain.com", "host2.domain.com") for HOST in $HOSTS do ...
Skone's user avatar
  • 519
4 votes
2 answers
442 views

Any ideas for automatic initial/scripted configuration of a NetApp?

The background is to make a solution where we can automate as much as possible the building up of ‘pods’ that include server/network/storage and that will be built at remote sites. In an ideal world ...
Chris Madden's user avatar
0 votes
2 answers
191 views

diff script command to mail

Is there a way to add a command to mail this if it finds any changes in the /newchanes.list. mail with an attachment(/changes) saying it found changes and if not then the subject line would say: no ...
user avatar
1 vote
1 answer
409 views

Linux / Sendmail one liner having trouble with large directories

For whatever reason, spammers found a way to relay mail through a side-system. The exploit has already been addressed. The problem is that I had massive amount of emails in my /var/spool/mqueue ...
Mike B's user avatar
  • 12k
14 votes
6 answers
22k views

Using mysqldump in cron job without root password

If I login with the root password on my box I can simply type mysqldump --all-databases and I will get th expected "Dump". I setup a job in cron.daily to run and dump this to a backup drive. The ...
Mech's user avatar
  • 660
0 votes
2 answers
549 views

How write script to print uncomment line

I have a very long config file with hardly comment and uncomment line Now I want to print out lines with uncomment # LOCAL PATHNAME INFORMATION # # The queue_directory specifies the location of the ...
billyduc's user avatar
  • 1,627
2 votes
3 answers
8k views

Change/Force Left-handed Mouse settings via GPO, or other ways

Is it possible to control Left-handed Mouse settings via GPO? (or a script that can be pushed using GPO :) I have Windows 7 / Windows Server 2008. Many thanks for your advice. Toast
ToastMan's user avatar
  • 544
4 votes
8 answers
1k views

Portable scripting language for a multi-server admin?

Please Note: Portable as in portableapps.com, not the traditional definition. Originally posted on stackoverflow.com, asking here at another user's suggestion. I'm a DBA and sysadmin, mostly for ...
Aaron's user avatar
  • 159
1 vote
3 answers
4k views

bash one-liner loop over directories throws errors

I'm trying to build a bash one-liner to loop over the directories within the current directory and tar the content into unique tars, using the directory name as the tar file name. I've got the basics ...
cori's user avatar
  • 381
9 votes
4 answers
14k views

Is there a way to prevent Thumbs.db from being created, on the SERVER side?

I have some scripts running on files located on a shared drive on a Win2003 Server. I need to look at the images on any number of PC's in our network.. so every time I browse these folders, the ...
user avatar
2 votes
1 answer
3k views

How to get the total records in my DNS SERVER (windows Server 2003)

How can i get the total records in my DNS Server (Windows Server 2003 - Active Directory Environment) Is it possible to get this information via Powershell/wmi ? Update: So far i used this with ...
Xavier C's user avatar
  • 773
0 votes
2 answers
1k views

how to switch serving server b/w primary,secondary when one of them is down?

I am new to web based apps.. my requirement is that a user accesses a URL that can be served by two servers- Primary and Secondary. When Primary goes down,the requests of that URL should ...
ashishsony's user avatar
3 votes
4 answers
370 views

Good shell scripting guide [closed]

I have the Orielly's "Learning bash". I also refer to Advanced Bash-Scripting Guide(tldp.org/LDP/abs ). Any other good books on the subject ?
nitin's user avatar
  • 2,599
2 votes
2 answers
84 views

Script to email if users "other than" login

I'm looking for an "alarm" script which will email if users other than those in a "authorised_users.txt" file log onto the VC 3 and/or esx 3 hosts. Allowed users can be created via VC permissions, ...
user avatar
3 votes
2 answers
550 views

How can I know when a Xen VM has started when starting using CLI

I'm using XenServer as a host for disposable QA machines for our application development. I'd like to write a script that automatically creates a new VM from a template, starts it, logs into it, ...
Electric Monk's user avatar
99 votes
9 answers
431k views

How can I fully log all bash scripts actions?

From my script output I want to capture ALL the logs data with error messages and redirect them all to log file. I have script like below: #!/bin/bash ( echo " `date` : part 1 - start " ssh -f ...
BlueMark's user avatar
  • 1,129
3 votes
3 answers
729 views

Write shell script that can only be run by a sudo user in Ubuntu

I'm writing a shell script that is supposed to be run by users only in sudo user list, what's the appropriate way of doing this? what I'm thinking is in the shell script, try to create a dummy file ...
user avatar
1 vote
1 answer
4k views

How to call a bash script from another script, as a different user? [duplicate]

Possible Duplicate: Run a shell script as a different user While writing scripts to automate the intialisation of SVN mirror repositories (svnsync), I again ran into problems trying to start ...
Jonik's user avatar
  • 3,021
2 votes
1 answer
670 views

How to install a Linux application in cases when parallel startup scripts running is enabled or disabled?

We develop a Linux application to work on different RedHat/SUSE distributions. This application (namely, daemon) is expected to be automatically run at startup so we place our startup script in /etc/...
user31462's user avatar
1 vote
2 answers
955 views

CRON job erratic behavior with Bourne shell script

I have the following script, that runs normally when I type the script name at the prompt (logscript): #!/bin/sh dvar=`date +"%m\/%d\/%y"` filedate=`date +%b%d%Y` echo DSS1 > serverlog_${filedate}....
Lance Roberts's user avatar
0 votes
2 answers
3k views

SSH not redirecting stdout to local terminal

I have the following relevant lines in a csh script: #!/bin/csh -xv set dvar = `date +"^%m\/%d\/%y"` set filedate = `date +%b%d%Y` set grepstring = "grep "\"$dvar\"" </home/user/log/logfile" set ...
Lance Roberts's user avatar
2 votes
6 answers
8k views

How to Crypt an sh script into Linux Environnement?

I've a tinny question, how can I crypt my scripts? I mean, for exemple, sometimes I've some sh scripts (provided by some company like VMWare) and when I VI's it they just show me a crypted file and ...
Dr I's user avatar
  • 975
6 votes
5 answers
8k views

BSD - Remove non-ascii characters from all files in a directory recursively

I'm trying to migrate a bunch (300GB+) of files from a FAT32 drive to my freeNas ZFS filesystem but every command I throw at it (tar,pax,mv,cp) throws an 'invalid argument' when it encounters a non-...
Dan's user avatar
  • 281
0 votes
4 answers
3k views

PST backup with Volume Shadow Copy Service

I was asked to implement the task of backing up 35 PST files ranging from 800Mb to 2000Mb. Windows XP and Windows 2000 workstations are assigned to the users and we have a Windows 2000 domain ...
NoMadMan's user avatar
2 votes
3 answers
6k views

Remote Desktop: logoff all sessions of a user

Somebody could provide me a tip on how could I make a script file (.cmd) which logs off the current user AND all other open sessions with same username? E.g.: I'm logged into three TS sessions with ...
user avatar
3 votes
8 answers
11k views

using ssh to reboot a computer when it is hung

I have a computer running tests, sometimes during a test it will freeze. I was thinking of writing a shell script to ping the test machine and if it is hung reboot it. I ssh into the test machine ...
user avatar
2 votes
1 answer
2k views

Running a shell script with its owner's privileges

On a Debian (5.0.3) server I have a user svnsync who owns a certain shell script: -rwsrwsr-x 1 svnsync users 119 Dec 21 13:45 mirror-svn.sh I'd like everyone in the users group to be able to ...
Jonik's user avatar
  • 3,021
21 votes
7 answers
19k views

Setting the Timezone with an automated script

I'm writing scripts to automate setting up new slicehost installations. In a perfect world, after I started the script, it would just run, with no attention from me. I have succeeded, with one ...
Tom's user avatar
  • 213
0 votes
4 answers
115 views

Extracting the last section of a log file

How can I extract all the contents of a file which comes after a given line ? The line can be matched by exact contents or regular expression.
Robert Munteanu's user avatar

1
30 31
32
33 34
37