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
7
votes
3 answers

Ubuntu Upstart script hangs on start and stop

I have an upstart script that will start a custom jetty server. When I do sudo start [myservice] nothing happens. Subsequently, sudo status [myservice] show it as: [myservice] start/killed, process 3586. Here's the script in…
Simon Woodside
  • 466
  • 1
  • 7
  • 15
7
votes
2 answers

run script with parameter in cron

I want to run .py script: python /home/project/manage.py slope_update If I run it from shell it's OK, but in cron does not work: */10 * * * * root python /home/project/manage.py slope_update What wrong? I edit my /etc/crontab file from…
Konstantin
  • 71
  • 1
  • 1
  • 3
7
votes
4 answers

Perl or Python, better suited for Unix system automation?

I have been using bash for most of my system administration tasks. I also know a bit of perl. Should I learn Python or Perl is better for system automation. So far from my experience learning perl has been easy.
nitins
  • 2,579
  • 15
  • 44
  • 68
7
votes
1 answer

Run command before and after printing with CUPS?

Problem A CUPS-Printer needs to be turned on automatically as soon as there are unfulfilled jobs Tried Solutions A shell script watches the queue on the server (lpstat -o) and turn on the printer when there is a job. If the queue is empty for 10…
leto
  • 261
  • 2
  • 5
  • 11
7
votes
6 answers

Delete temporary files from batch script in xp

I'm looking for a good batch script that would quickly find & clean all the known safe temporary folders/files from Windows (as many variants as possible) machines (e.g. the windows temp folder, all users IE temp folders, etc.). I'm fond of UI tools…
Keith Bentrup
  • 719
  • 3
  • 8
  • 19
7
votes
3 answers

echo based on grep result

I need a one liner which displays 'yes' or 'no' whether grep finds any results. I have played with grep -c, but without success.
takeshin
  • 1,471
  • 3
  • 21
  • 28
7
votes
3 answers

Delete a windows group in Active Directory

I am doing a cleanup of some AD groups that are no longer used. One of the AD groups I could not delete because it seems that a member has this group set as the primary group (which I assume someone did by accident). Is there an easy way to find out…
Jim
7
votes
2 answers

Run a script after I unlock my Windows session?

How do I run a script each time I unlock my Windows 7 session? So, if I lock my session and then log in again, I want the script to run. Do login scripts configured in the Group Policy do this or will they only work the first time?
Tamara Wijsman
  • 388
  • 2
  • 4
  • 16
7
votes
5 answers

Secure method of changing a user's password via Python script/non-interactively

Questions Is there a more secure/better way for setting a user's password non-interactively via a Python script? My current solution uses chpasswd from a Fabric script. Another option would be to use Pexpect from within the Fabric script. Is my…
Matthew Rankin
  • 1,175
  • 5
  • 15
  • 32
6
votes
5 answers

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-ASCII filename - it's usually something that's been…
Dan
  • 281
  • 4
  • 11
6
votes
3 answers

Change Passwords for All Users on Linux Server

I've got 10 Linux servers that I need to lock down, by resetting the passwords for every single user all at once. The story behind this is long, but the general idea is that I need it to happen very quickly at a specific time. I'm going to use a…
6
votes
7 answers

Automating Administration Tasks on Windows

What tools do you use and recommend for automating administration tasks for Windows-based computers? Examples of such tasks include: Installing/upgrading software Standarizing application settings Remove blacklisted applications A standardized…
berberich
  • 1,882
  • 15
  • 18
6
votes
2 answers

Query Powershell Error Object Time Occured

Powershell error objects contain a lot of data but I can't seem to track down the time of occurrence for a given error. Using $Error[0] | fl -f retrieves a lot of information but none that appears to be a date time of when the error was generated. …
Colyn1337
  • 2,397
  • 2
  • 23
  • 40
6
votes
1 answer

Preprocessor for Dockerfile with variables and include files

I have been using docker for a number of my applications now. I have gotten to the point that I have about a dozen dockerfiles. Frequently I have to make the same change or include something in a number of dockerfiles - which means I have to make…
Anin Smith
  • 61
  • 3
6
votes
8 answers

Ubuntu - dhcp server 'not configured to listen on any interfaces'

I'm at my wits end on this one; I have tried for hours to get this to work, but I'm stumped. Hope one of you can help. :-) I'm trying to get dhcp3-server to work on Ubuntu. It's installed, and setup correctly to run in rc2,3,4,5.d runlevels. On…
Jez
  • 1,393
  • 2
  • 12
  • 24