All Questions
69
questions
0
votes
1
answer
486
views
How do I prevent systemd from running my timer after reboot
I have the following oneshot service+timer :
$ systemctl cat stop_syncro.service stop_syncro.timer
# /usr/local/lib/systemd/system/stop_syncro.service
[Unit]
Description=Service d_arret de la Synchro
...
0
votes
0
answers
114
views
cannot run command on Centos7
I've got a vps using Centos, the release version is 7.9. I've install the unhide in my vps.it does not work.
I've check the permission, and the file type.
but i still cant run this command . it's ...
1
vote
2
answers
1k
views
RPM none-zero exit code if a package is already installed
I created a new script to install a few local packages on CentOS 7 without internet. I want script exits upon any error
set -e
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
rpm --import ./RPM-GPG-...
0
votes
1
answer
129
views
Getting a Particular Binary Package from A Source Package?
(Sorry if the title is worded incorrectly - I am a newbie in this domain, so please correct me wherever I am wrong)
From https://packages.ubuntu.com/source/bionic/amd64/hdf5, I am trying to get the ...
0
votes
0
answers
223
views
Issue with add Multiple user account and SSH key using Bash script
As per our requirement we provided our devloper group: devs:r-x to /var/log/httpd directory.
What is the best way to create a user account (in my case Dev User) in a Group using bash scrip, with the ...
0
votes
1
answer
1k
views
How can I correctly run a java batch application (a .jar application) in background on a Linux machine?
I am not a system engineer (I am a software edeveloper).
I have to run a Java application (a runnable .jar file) on a Linux machine (Centos 7). I am connecting to a shell via SSH.
This application is ...
0
votes
0
answers
273
views
How to view or record user's active time in Linux server
I'm a server admin for a university, and we have 4 CentOS servers that students can use for their projects in various classes. The CS professors have asked me to come up with a way to track a user's ...
0
votes
2
answers
90
views
How to delete any archives older than W weeks, but still keep up to N archives?
I have a CentOS 7 directory that gets filled with tar.gz archives for different packages, where each package can create multiple archive versions.
I'm trying to find a way to delete any archives ...
0
votes
1
answer
439
views
How to call .bash_logout on CentOS
I'm trying to call my own .bash_logout on CentOS when a user logs out. However, even when an 'exit' command is sent, .bash_logout is NOT called/executed (it just logs out).
On CentOS, when I type '...
0
votes
1
answer
133
views
Dos2unix different behavior on macos and centos?
I have a file which I need to convert to unix format, so I am doing dos2unix filename.txt. But the format of the file after conversion is different on CentOS when compared to the macOS format.
I have ...
0
votes
1
answer
226
views
Jenkins service user to restart mongodb service
Centos 7.
Usually when I would like to run a sudo command as a non root user, I open up the visudo, and add this line to the right place:
%<userGroup> ALL= NOPASSWD: <command>
when I ...
0
votes
2
answers
44
views
How can I empty files at the same time with same paths?
I have a structure like this:
Father:
├───Charlie
│ └───lang.log
├───Ava
│ └───lang.log
├───Sophia
│ └───lang.log
...
I would like to clean up the scheme. I try:
cat /dev/null > Father/*...
0
votes
1
answer
1k
views
Deleted /usr/bin/docker on CentOs
I wanted to uninstall docker from my CentOs Machine and run this script :
curl -sSL https://get.docker.com/ | sh
But it told me that the docker command was already available on the system and it ...
0
votes
1
answer
805
views
CentOS - Path shows /usr/local/bin but installer shows path error
I'm trying to install heroku on a virtual machine running CentOS. When I use
curl https://cli-assets.heroku.com/install.sh | sh
I get an error message saying that my path does not include /usr/local/...
0
votes
1
answer
622
views
Return to ec2-user from a custom user
When creating an ec2 instance I use a bootstrap script. On the instance I install and configure an nginx web server. For security reasons, I need to create a new user (www-data).
The www-data user ...
1
vote
2
answers
2k
views
IPTables - Allow (ACCEPT) specific IPs within a blocked (DROP) subnet
I'm fairly new to IPTABLES, but I've written a script that blocks several of Amazon EC2's IP ranges from an input file, blacklist.txt:
...
54.66.0.0/16
54.67.0.0/16
...
I also have a separate ...
2
votes
4
answers
4k
views
Cannot chroot /mnt/sysimage After Putting New Image on HP Computer
I am using Clonezilla to put a new CentOS 7 image on our computers. Most of them are Lenovo desktops, and we have a few HP desktops that are all currently running the old image.
In order for the new ...
0
votes
1
answer
457
views
What is the behavior of mv on /?
One of our users accidentally performed mv /* ../ without root permission. After checking the effects using diff I was surprised to find that mv apparently functioned as cp when applied to the / dir.
...
1
vote
1
answer
3k
views
upload file to ftp using bash script Linux
I know this is a pretty simple question but unfortantly I can't find any solution for my problem.
I have file called: x.txt inside the root directory /x.txt.
And I want to upload the file into my ...
0
votes
1
answer
436
views
Run jpegoptim in a cronjob once a week, on CentOS from within cPanel, only for files added within the past week?
I've installed jpegoptim and can manually run it via the SSH command line:
jpegoptim *.jpg --strip-all
I'd like to take that command line and put it into a Cronjob that runs once a week. I'm running ...
0
votes
1
answer
243
views
Why is this simple cronjob not running and how do I check the relevant log files?
I have an 'R' script that I wish to run at 00:30 every day, that is, 12:30 AM everyday. The script itself is located in ~/Desktop/foldername/runme.r and which Rscript tells me that the exact path to ...
0
votes
2
answers
1k
views
cron job on centOS 6.5
I have used these 2 references to insert a new crontab entry.
redhat
ubuntu
I have created a new bash file and moved it to /usr/bin. That sh file has execute permissions for the root user and the ...
2
votes
1
answer
7k
views
Linux - create screen as another user
I'm trying to create a new screen on my server (CentOS 5.11), but instead of starting it with my user, I would prefer to use another user with restricted permissions, just to be on the safe side.
So, ...
5
votes
1
answer
10k
views
Whitelisting commands a user can use with sudo
I've been attempting to set up a whitelist of commands a user can run on my system. The server I'm using is running CentOS 7. What is the syntax that should be used to only allow a certain group of ...
2
votes
1
answer
6k
views
bash: /home/user/.bashrc: Permission denied when try to change user from root to user
I'm on centos, when I login as root and use su x to change user to x, it shows this:
bash: /home/x/.bashrc: Permission denied
I try to source ~/.bashrc but nothing changes and I also tried following ...
1
vote
0
answers
51
views
CentOS - using PXE to install it on my host ( kickstart configuration )
I am trying to install an OS from our server through PXE ( Preboot Execution Environment ).
However, on my host, I have two disks say A ( /dev/sda ) and B ( /dev/sdb )
The default installation path ...
2
votes
1
answer
122
views
Running a process in the background using &
I have created the following script:
#!/bin/bash
while :
do
echo "1" >> test.txt
sleep 1
done
If I run the command using ./exm.sh & it runs on the background as expected and it ...
-1
votes
2
answers
293
views
formatting output in bash shell to remove special characters - linux
I am issuing the command below against a logfile
grep "Oracle Audit" /var/adm/messages | awk '{print $6}'
How do I format the below output
Audit[9460]:
Audit[10507]:
Audit[10507]:
Audit[10507]:
to ...
0
votes
1
answer
12k
views
-bash-4.2$ for command line?
I don't know why when I SSH with putty onto my VPS, my command line starts with: -bash-4.2$ It hasn't ever been like that, it was myname@localhost
Only thing I have done different in the last 24 ...
1
vote
1
answer
474
views
redirection - why it doesn't work this way
I know there are 3 streams attached to a process when it is run namely the input, output and error stream.
And redirection execution work from left to right.
I intend to execute a command, redirect ...