Questions tagged [shell-scripting]
Programming in an Interpreted language executed by a running Shell
624 questions
Score of 0
0 answers
25 views
crontab script is not running in other server. In the server we copied, it's running fine [duplicate]
see below details
eccdbpvm02:/mnt/HANA/E1P/backup/data/DB_F1P # crontab -l
05 00 * * * /usr/sys_scripts/clear_log >> /usr/sys_scripts/log.txt 2>&1
eccdbpvm02:/mnt/HANA/E1P/backup/data/...
Score of 1
1 answer
168 views
shell script in $PATH does not execute
I have a couple of custom scripts to help me with more or less regular tasks;
and recently decided to move them from /usr/bin to ~/bin to have a better overview.
I also added home/myusername/bin to $...
Score of 0
1 answer
71 views
How to close all files and ports from parent process
I have an HTTP server (source code not accessible and cannot be substituted at this time) running on my Linux machine, which can be configured to execute any commands on requested. However, the HTTP ...
Score of 0
0 answers
159 views
Running docker run commands from a shell script without sudo or docker group
I have a containerised command I'd like to run: docker run my_docker_image. Rather than install the command's dependencies into the main computer, I'm packaging them all into an image, that then users ...
Score of 1
2 answers
1059 views
How to get global IPv6 address of the current machine?
I a bash script, I want to obtain the global IPv6 address of my machine for a given network adapter (on my case 'ens18').
To get started, I issued the following command:
ip -6 addr
This gives me the ...
Score of 0
1 answer
123 views
sh Script Syntax Assistance
I'm trying to write a script that will read search strings from an input file and then execute a command with $string in the middle of the command line. This is an example of the working command line:...
Score of 0
1 answer
177 views
Why "HISTFILE" variable not read by "readonly" command in shell script?
When I run command bellow in bash shell :
if [[ $(readonly | cut -d= -f1 | grep -qo HISTFILE && echo $?) == 0 ]]; then sudo grep -iwo "readonly HISTFILE" /etc/profile /etc/profile.d/*...
Score of 1
1 answer
316 views
not able to send mails from linux ubuntu : 20.04 by using email mailutils (sendmail or mail keyword)
code :
subject="mail subject"
body="Hello World"
from="[email protected]"
to="[email protected]"
echo -e "Subject:${subject}\n${body}" | sendmail -f "...
Score of 0
1 answer
1380 views
What is the correct way to check monit status/summary success/failure
I have monit utility on production for monitoring several daemons (our micro-services). I'm trying to figure the best way to unmonitor/monitor my daemons while updating them. So, basically I need ...
Score of -1
1 answer
103 views
Extract Pages from Various PDF Files into New PDF File [closed]
From
a.pdf, I would like pages 2 and 5
b.pdf, pages 3 and 4
c.pdf, pages 7, 8, and 9
copied into a new PDF file.
All input pdf files are ten pages long.
I'm using bash, and plan to make many ...
Score of 0
2 answers
64 views
trying to see if how many times service Accounts was logged in [closed]
Hi I am new to shell scripting ,I am trying to see how many times an accounts were logged in the log file.
If an account was logged in more than 20 time I need the name of those accounts to be printed....
Score of 0
1 answer
435 views
Unable to List Contents or Create Files in /var/tmp Folder from PHP Executed Bash Script
Objective:
I want to trigger a webhook on a private linux-machine (its a local system not connected to internet), which can delete the spool data generated by CUPS server in /var/tmp folder.
To ...
Score of 0
1 answer
106 views
time nohup ./script --> the time hasn't been logged [closed]
I need to measure the time that Firefox takes to build itself from the source code. Here's what I do normaly:
nohup ./mach build > my_log.log &
I then prepended time to it:
time nohup ./mach ...
Score of -1
1 answer
280 views
Copy/Move Entire Line To End Of The Line Above
I have a file that looks like the following:
/path/to/a/very/long/path
0 0 0 0 0 0
I need to move the line starting with a number (this can be any value not necessarily 0) to the end of the ...
Score of 1
1 answer
153 views
Hardening the security of a backup shell script of a web-server with mysql database
In the case of a simple web-server with a MySQL database, the script has to dump the database, copy the web-server files and tar everything together. Then a NAS server Rsync the tar file via a "...