Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions tagged [scripting]

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

0
votes
0answers
13 views

INotify: Treatment of bulk moves vs. individual files

Our environment is making use of inotify events for the purpose of triggering file transfers, but with our lab being a closed environment it is difficult to replicate inbound streaming file writes. ...
0
votes
1answer
35 views

List all Linux servers where my account was created

I'm a new Linux sys. admin (in the past, Windows sysadmin) We have 400 and more Linux servers. On some servers my account is create and on some not. I want to know wich server I have to ask for ...
0
votes
0answers
18 views

BAT script include credentials to two network machines [closed]

I have a batch file which executes every 10 minutes to copy all files from three directories on a machine, to three destination directories on two other machines on a network. Two of those ...
0
votes
1answer
27 views

debian cron.hourly script not executing

New to cron on debian 9 , I have a file called ipupdate in /etc/cron.hourly/ipupdate -rwxr-xr-x 1 root root 132 Jul 11 18:21 ipupdate the file has a single curl command like this: curl "https://..."...
0
votes
2answers
108 views

CentOS 7 custom service failure (Interactive authentication required)

I am trying to setup an OFBiz fork called Scipio as a service on CentOS 7. The service wrapper script changes the user to a dedicated one for the program. All of the program's files are owned and in ...
1
vote
0answers
57 views

Set Windows 10 Default Start Layout

How can we set the default start layout and task bar icons for each user in Windows 10, yet still let users modify them later? I know you can use an XML file to set these, but a standard XML file ...
0
votes
1answer
165 views

how to open sftp connection and execute sftp commands in shell script?

I need to connect to multiple SFTP connections and copy files to my system. I will maintain one CSV file in our local system. It will have multiple partners' information of username, password, ...
0
votes
1answer
89 views

Powershell - piping in related variables from a list

I am trying to export formatted folder ACL permission list for a limited set of folders on a file server. I have a list of folders to read out permissions from and a list of file names that I want to ...
3
votes
2answers
107 views

How to run a script on a server 1 minute after a commit has been made?

Apart from creating a 2nd script which would check the time of the last commit and then run the main script and which would be too complex of a solution, is there a simpler one?
1
vote
0answers
41 views

ideas needed - cut the smb connection when disk full

Hello sometimes we are having issues like when some misbehaving user copies files to a server via admin share or other share and he causes disk drive to fill and a p1 ticket be created by monitoring. ...
0
votes
0answers
28 views

debian 9 script to add sudo user

I was trying to make a script to set up a sudo user . Copy pasting one by one Debian commands work , but not running in script . Debian9=$(lsb_release -a 2>/dev/null | grep '^Description' | awk '{...
0
votes
0answers
36 views

What are the Non-GPO settings like Fine-Grain Policy settings that affect AD objects in Windows AD environment

I would like to know the list of possible settings available in Windows AD environment (irrespective of version) that are Non-GPO settings which could be used to modify the configuration of an AD ...
-1
votes
3answers
226 views

Bash script: save last line output from terminal

I am writing a bash script in which I would like to save the output of the last command in to a variable before running my next one so I can display it later. I have tried a few different methods ...
2
votes
1answer
62 views

fdisk with a a single command fail in the second execution

I ran a script to format a disk with fdisk like this: (echo n; echo p; echo $number_part; echo $firs_sector; echo $second_sector; echo t; echo $format; echo p; echo w) | fdisk /dev/$disk when i ...
1
vote
0answers
77 views

remote powershell unrecognized command when calling functions

I have two servers. Server A needs to contact server B and run a specific function withing a powershell function library (just a .ps1 file) that I've created. The function that is being called also ...
0
votes
0answers
17 views

Making post alert script for snort

I`m trying to make a script that trigger an action if 5 snort rules ware broken in 24 hours interval. I`m putting all my snort logs in alert.log Can some one help me to make a script that motor this ...
0
votes
1answer
41 views

Appending deployment.properties to enable TLS

I need to be able to append everyone's deployment.properties file to add additional lines to enable all versions of TLS. Big enterprise uses multiple different versions of Java and also multiple ...
-2
votes
2answers
56 views

Check existence of multiple network shared files

Let's say I have a list of files (files.txt), which looks like: \\myshare\file1 \\myshare\file2 \\myshare\file3 How is it possible to check via a batch script (windows) to check if those files exist ...
0
votes
1answer
204 views

Appending to an array within a ForEach-Object loop

I've run into a strange problem when attempting to append to an array from within a ForEach-Object loop that is traversing another array. I have attempted to recreate the problem as concisely as I ...
1
vote
0answers
106 views

Set-Acl : Attempted to perform an unauthorized operation while using Addaudit Rule

I am trying to run Powershell script to set Audit Rule on C:\Windows\security folder on my Windows 2008 box. Below is the script: $FileDirList = ("C:\Windows\security") $AccountName = New-Object ...
1
vote
0answers
75 views

automate server downtime for different servers at different days and time

I have created script with Ansible and also with Python to put servers down in my work environment but If I can create group of all servers and set their downtime at once. Example: If I need to put ...
0
votes
0answers
92 views

how to delay LAN using batch script or cmd

I want to delay local area connetion (like clumsy tool) using batch script or command prompt. Basically I want to make network delay for my test purpose. I have no idea from where to start and how.
0
votes
0answers
17 views

auto update 1 vhd when another collects the updates

I have a server running server 2012, failed at making a shared vhdx. Instead I mounted the created vhd to another computer installed the games and programs I wanted. Unmounted the vhd and the copied ...
1
vote
0answers
45 views

Verified data retrieval from source with limited access

Briefly: I need to download data from a linux-based device, verify data integrity, and delete the source files (can't use rsync). Details: I have a hydrophone deployed at the bottom of the ocean as ...
-1
votes
1answer
52 views

Checking if a programm is running on linux

i'm trying to check if a program on a linux server is running and start it if not. But i get strange errors: #!/bin/sh SERVICE=nrpe ps -ef | grep -v grep | grep $SERVICE | wc -l if [ $? -gt 1 ] ...
1
vote
3answers
71 views

I want the bash script to echo only if I execute and not echo if executed by a cron job

I want to echo to the terminal if the script is being executed by me, in the flesh or I want to echo to a log file if it is being done via a cron job. Ubuntu 16.04 example: #!/bin/bash if [ ***** ]...
0
votes
1answer
50 views

How to monitor VMs and its resources under google cloud (GCP)

I have couple of VMs created on Google cloud platform and deployed tomcat based applications. Now, I would like to monitor the resources (like Memory , CPU, disk , applications etc). Is there any way ...
0
votes
0answers
55 views

Powershell Script returning unexpected value while attemting to automate software removal

I'm attempting to write a script that will be used to automate the removal of HP bloatware from the stock images on a fleet of HP laptops that we will be deploying for a client. So far I have: $...
0
votes
1answer
92 views

Script to delete many old user profiles from network share?

I have a network share on a Windows Server 2012 machine that is used to store all the user profile files (My Documents, Desktop, etc). There are hundreds of old users I need to get rid of and I am ...
0
votes
0answers
43 views

Simplify Bash IF statement when using set -e

I have many lines of code, like this: #!/bin/bash -eux set -o pipefail # do something else here with error checking and command logging set +e if ! dpkg -l htop | grep -qE '^ii'; then set -e ...
0
votes
0answers
29 views

Update win 10 remotely from .wim file? No server

I am looking for a way to remotely update (or reinstall) Windows 10 systems from a .wim file, and no I sadly I don't have access to SCCM or WDS... I did find Automate Windows 10 In-Place Upgrades ...
0
votes
2answers
318 views

How to su non-interactively?

I want to do something like this to non-interactively switch user: su otheruser -p <password> But this obviously doens't work... what will?
0
votes
2answers
116 views

Bash script shows error for “pwd”, simple script

I'm trying to make a Bash shell script but it is not working. Here is the contents of the script: #!/bin/bash pwd I would expect this to print out the current directory. Instaed, it prints this: ...
2
votes
2answers
28 views

Can different scripts share a lockfile to ensure they don't interfere with each other?

I've used flock a lot in the past to ensure that a process only spawns once (in case it gets hung up/etc) but I've never used it for two different processes. In this scenario two different scripts ...
0
votes
0answers
243 views

WSL command execution at startup/shutdown from Local Group Policy Editor in Windows 10

The base is a fresh install of Windows 10 with the Windows Subsystem for Linux (WSL) enabled and with a Ubuntu installed. The tool is "Local Group Policy Editor" under "Local Computer Policy > ...
0
votes
1answer
18 views

script to load balance webpages

Im new with shell scripting, and I need help, to create this scripts. I have 2 apache (active/standby) servers, and what I need is to have one script that will check the status of the server 1 (wget ...
0
votes
0answers
36 views

Centrally administering JInitiator settings

We have software in our network that relies on the JInitiator to function, and requires some custom settings within it: The cache directory needs setting. Cache size should be unlimited. A runtime ...
0
votes
1answer
94 views

Read all lines for .txt powershell

I have a PowerShell script that when I run it, create a local amdmistrator on the computers that I select and it gives me another txt in which they were created. But from the txt where the host ...
2
votes
1answer
1k views

Read file with parameters as parameter in powershell script

I have tried to do a powershell script the reads a file with parameters: File with parameters (params.ini): [domain] domain="google.com" [port] port="80" Powershell script that reads the file: Get-...
-1
votes
1answer
61 views

What is the os.uname prompt on ESXi [closed]

I want to check with a python script if my system runs on an ESXi but I have never worked with one. My script should only work on ESXi but I have no clue what the cli prompt would look like or how to ...
3
votes
2answers
138 views

How to check that mstsc.exe has successfully set up a RDP connection?

We use mstsc.exe to establish RDP connections to other servers in batch files, which are then terminated after some tasks have been run. This basically works fine, but every now and then it takes ...
0
votes
1answer
64 views

Can I separate shell script ifs into multiple files?

So here's is the scenario, I have a shell script that based on a network command it execute an action, it may be a service restart or stop. That part is working fine, but I'm stucked at a part that I ...
1
vote
1answer
67 views

abc='^.{2,1000}$' meaning in shell script?

I got a script & found this parameter. what will happen by using this in my script. I tried to find the way but didn't get any specific result. abc='^.{2,1000}$'
-1
votes
1answer
62 views

Remove wildcard entries between IP's in file

I have a very lengthy file(more than 4000 lines generated per day)in the following format. yqiemmtcveihai test-trans 10.227.30.66 <-----------> 14.192.17.143 <-----------> ...
2
votes
1answer
101 views

Detect spam sending script or user

I have been hired by a customer to secure his email server to prevent spam and so. They have Plesk Onyx with Postfix as MTA. I have installed incoming spam filters (barracuda, etc...), developed a ...
0
votes
1answer
600 views

'systemctl restart service' not working on CentOS 7

I have a custom service managed by an init script in /etc/init.d and, after upgrading to CentOS 7, with systemd, 'systemctl restart service' is not working correctly. I need to execute two times '...
1
vote
1answer
85 views

Storage profile error when deploying new machine using json template

I'm trying to deploy two vm's in an avset using visual studio 2015. I get the error message below when I attempt to deploy: New-AzureRmResourceGroupDeployment : 2:03:59 AM - Resource Microsoft....
1
vote
1answer
156 views

Error when deploying JSON template

I'm trying to deploy two vm's in an avset using visual studio 2015. I get the error message below when I attempt to deploy: Reference Id 1 is not formatted correctly. The Id is expected to reference ...
0
votes
0answers
418 views

interact: spawn id exp0 not open

I am very new to scripting and I am trying to build a very simple script that connects to a list of IP addresses via SSH and attempts to login using bad credentials. I need this in order for those ...
0
votes
2answers
28 views

HTMLDOC script multi conversion

I am trying to convert multiple htm files to pdf using HTMLDOC. I can convert a single file with the following: htmldoc --webpage -f filename.pdf sample/filename.htm. I try making a script and it ...