0
votes
0answers
10 views

pipe rrd to a new directory

I am chrooted and running out of drive space, so I mounted back to the host drive which has plenty of space but cannot seem to pipe the outputted data to my empty drive [root@localhost rra]# ls ...
0
votes
0answers
23 views

BASH: Create a temporary password variable that doesn't get stored in history? [duplicate]

I have a script that runs a curl request in a loop. The request needs to include my credentials using the --user option. I'd like to assign my password to a local variable $password, and then supply ...
0
votes
1answer
28 views

crontab truncates file path

I try to run the following command: crontab -u root /root/iss/current/node/bin/installers/nl_brandless_selector_full_hd/nl_brandless_selector_full_hd_cron_file But I got an error like this: ...
0
votes
0answers
19 views

different interactive and non-interactive shells

A user account has it's shell defined in passwd file as bash. I would like to change this user account's shell to tcsh for non-interactive jobs (like ssh ), but keep interactive shell to bash. Is ...
-2
votes
0answers
25 views

Querying a remote POP3 Mail server using BASH [migrated]

I'd like to connect to our mail server, look for a certain pass phrase in the subject and if found then run a script. How can I achieve this with BASH other than awkwardly scripting Telnet? Thanks!
0
votes
2answers
88 views

Linux/Bash: Test if my server is opened to the Internet programmatically/via CLI

RHEL 6 and Bash. It would be easy if I had a remote server to just run nmap from, or even curl/wget, but I only have access to servers on our side of the firewall. I know I can manually check ...
0
votes
1answer
38 views

CentOS 6.5 proxy bypass/no_proxy not working

I am running CentOS 6.5 on my desktop. I've set the Network Proxy using the network proxy application provided under Preferences. I've also set the following exceptions: ...
1
vote
2answers
60 views

script to count the occurence of the particular string in the given time interval

We are trying to write a script "sendemail.sh" to count the number of occurrence of a particular string in a log file "SendEmail.log" within the given interval. We have a log file. In that we are ...
-2
votes
1answer
33 views

Bash Script to Compress / Transfer / Remove Log Files [closed]

I am currently using chronolog to set log file names for Apache with date. They are in the following format: /WEB/LOGS/APACHE_ACCESS_YYYY-MM-DD.log /WEB/LOGS/APACHE_ERROR_YYYY-MM-DD.log I would ...
15
votes
5answers
771 views

Piping wget output to /dev/null in cron

I am running the following command every 5 minutes in my crontab to keep Phusion Passenger alive. */5 * * * * wget mysite.com > /dev/null 2>&1 When I run this it performs a wget on the ...
3
votes
1answer
27 views

In tar how can I exclude dir contents but leave empty dir

I want to create a tar file excluding certains folders who have many sub-folders and files, but leaving only the main folders that's being excluded. Explaining: -project |-dir1 |-dir2 |-cache ...
-5
votes
2answers
45 views

Bash Script that downloads a file and checks the value if 1 or 0 [closed]

I need a Bash Script for Debian which downloads a file, that file containts 1 or 0, 1 when the services is running, 0 when not. So how can I check if the file contains 1 or 0?
0
votes
1answer
44 views

Where is this bash shell alias being configured?

While logged in as root onto a CentOS 6.5 system, I run ># alias alias cp='cp -i' alias l.='ls -d .* --color=auto' alias ll='ls -l --color=auto' alias ls='ls --color=auto' alias mv='mv -i' alias ...
-1
votes
2answers
70 views

Delete all files except the newest of each day

I have dump directory that is filled at the rate of one file per 4 hours. I wish to keep all files for a week then delete all except the newest of each day. Bash is preferred though other solution ...
0
votes
1answer
35 views

Modify the command line that gets saved to history / .bash_history in Linux

When commands are saved to history in Linux, is there some way to prepend the command line in the history with the remote SSH IP address and process ID so that it's easy to group commands from the ...
1
vote
2answers
53 views

I need to augment my output to include cat-ing a file in this Bash script

I have a script querying a remote server based on user input and looks for the last modified date of a file. It works, however, contained in the file is a string that I need to have displayed as well ...
0
votes
0answers
14 views

Disabling ssid broadcast programatically/CLI and keeping exsisting devices connected DD-wrt access point [closed]

I'm trying to disable/hide my SSID broadcast programatically in order to stop devices connecting to my access point (not for security reasons). I have tried renaming the SSID and setting it to nothing ...
1
vote
2answers
128 views

Systemd exits from bash scripts that execute commands that result in failure, instead of continuing

I'm trying to get a script that pushes up my system log on CoreOS to logentries. To compensate for the fact that instances don't have internet connectivity right away when being spun up on AWS I've ...
3
votes
8answers
122 views

list linux partition names only in bash

df on linux lists the following stats on partitions. -bash-4.1# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 1918217320 1473337340 347440136 81% / ...
2
votes
2answers
96 views

/bin/sh: difference between variable and direct command

Imagine i have following bash script: #/bin/sh #next line will work correctly, outputting user name and current directory start-stop-daemon --start --exec /bin/su -- root -c 'whoami; ls' ...
0
votes
1answer
44 views

Binding timestamp value to a variable in crontab

I'm basically trying to declare a variable with a date() value in crontab as I will constantly be using the same date structure over and over, here is what my crontab looks like so far. php = ...
0
votes
0answers
24 views

Odd behaviour with varnishlog and stream redirecting

I wrote a helper to debug varnish installation and have used it on both production and development server. The odd thing is, I encountered different behaviour even though the setup is nearly identical ...
-4
votes
2answers
45 views

Linux User generation script [closed]

Was wondering if someone could point me in the right direction. I'm wanting to create a simple bash script to create user account. The script will need to prompt the admin for a username and ...
0
votes
0answers
13 views

Ctrl-C is ignored by pppd when put in a shell script

I'm trying to connect to GPRS network through a serial port connected GSM modem. When I call /usr/sbin/pppd call <peer_name> from the command line, It correctly receives and handles Ctrl+C from ...
0
votes
2answers
77 views

How to use the new ifdown and ifup?

I would like to change the MAC address on a Fedora 2o webserver, but it seams that ifdown and ifup doesn't work like they used too before systemd were introduced. This is what I would like to do ...
0
votes
3answers
84 views

Tail a file from ssh and mirror to a local file

To tail a file over ssh, I can use ssh -t remotebox "tail -f /var/log/remote.log" However, it is possible to sync the tail with a local file? So a file automatically mirror the update of the tail ...
2
votes
2answers
72 views

Two databases synced backup

I got a system that need two databases to work. I need a script to backup both databases at given point of time. I need databases to be in sync, so I need to be sure that backup does not allow changes ...
3
votes
5answers
202 views

Hide the output of a shell command only on success?

Hiding the output of a shell command usually involves redirecting stderr and stdout. Is there any builtin facility or command which by default hides the output but on error dumps all the accumulated ...
4
votes
3answers
277 views

Understanding the different directory sizes

When comparing root@debian:~# du -s /backup/test1/ 5605364 /backup/test1/ two directories with du, root@debian:/etc/init.d# du -s /data/test1/ 5605360 /data/test1/ du tells me that there is a ...
1
vote
1answer
421 views

Fork a process inside a bash shell script

I've a simple shell script like #!/bin/bash sh -c "sleep 60" & exec sleep 120 In using the pstree command, I found something like `-sleep(11681)---sleep(11682) The first sleep is due to the ...
8
votes
6answers
360 views

Find directories, where files with a specific ending are missing

I want to display all directories, that do not contain files with a specific file ending. Therefore I tried using the following code: find . -type d \! -exec test -e '{}/*.ENDING' \; -print In this ...
0
votes
1answer
112 views

ways to automatically fix line endings in shell scripts or files who break with ^M

Problem We regularly break our files lines endings and things stop working without us noticing. Bash complains about "invalid option" or ": command not found" as described here: ...
1
vote
4answers
293 views

How to make a copy of /proc/xxxxx? [closed]

A users account have been hacked on one of my servers, where the hacker have started some spam binaries. Before I kill the processes would I like to make a copy of them, but when I tar czf ...
-3
votes
1answer
65 views

How to get count of email accounts per user in cPanel? [closed]

This question is similar: Finding out the total number of email accounts in a cPanel server which I would love to comment on, but can't because of reputation. This one-liner works well to get a total ...
0
votes
1answer
60 views

Check result from grep of apt-get and use in bash conditional

I am trying to test for information about a specific package version on Debian. However, my grep against the result from APT doesn't seem to be doing anything. I'm not sure how to write the bash ...
1
vote
1answer
74 views

Replacing LineFeed \x0a with SED

I have to delete lots of Linefeeds (Hex \x0a) in a logfile. I just have sed to solve the problem. It is a bit complicated I know.. Do you have idea how to solve the problem? Here is an example ...
0
votes
2answers
77 views

Use inotifywait and lftp to synchronize servers

I have two servers: Server A (CentOS), where people can upload files to (upload root is /files) Server B (Win 2008), with FileZilla FTP Server (FTP root is C:\content) I want that whenever a file ...
0
votes
0answers
33 views

Refine grep look behind to avoid numbers

When I query docker images, I get this: #> docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE local/debian 7.5 172c7702a46f ...
0
votes
1answer
125 views

Disable the ability to hide bash command history

User can hide the command history in bash by either append a space before the command unset HISTFILE How to disable this?
1
vote
2answers
120 views

How to split a file and compress directly?

I've a 100GB file and I want to split into 100 of 1GB file each (by line break) e.g. split --bytes=1024M /path/to/input /path/to/output For the 100 files generated, I want to apply gzip/zip to ...
1
vote
1answer
50 views

Difference between “crontab -e” & editing crontab file manually? [duplicate]

I noticed some people use "crontab -l" to view cronjobs and "crontab -e" to edit them. However there are also times where people manually modify "/etc/crontab" to view/add/remove cronjobs. Both ...
0
votes
2answers
88 views

Gnu parallel not utilizing all the CPU

I have a simple python script that read from stdin (a single line), do some processing (string parsing, no IO involved) and output to stdout e.g. python parse.py < in.txt > out.txt I have an ...
0
votes
1answer
39 views

Run script on boot [closed]

Is there a way to run a .sh script ONCE when I boot? I know about the init.d folders, but there seems to be some weird special layout you must use for scripts there. I only want to run two quick ...
5
votes
1answer
252 views

Where is $BASH_ENV usually set?

I have twin Linux servers that should be configured identically, however ssh commands to one of them are failing for commands that require a path that's specified in ~/.bashrc. For example, I can use ...
1
vote
0answers
87 views

Linux Script to login to Raspberry pi and run some scripts inside raspberry pi [closed]

This is my scenario, We have some sensors on different sites, these sensors are connected with some equipment having SIM cards in it to allow the internet connection. On the other hand, we have a ...
-2
votes
1answer
84 views

Bash and cron error [duplicate]

The following cron job fails to execute. What's wrong with it? It works fine when I run it directly from the shell prompt. www-data@etl:~$ crontab -l SHELL=/bin/bash MAITO="" 0 5 * * * export ...
0
votes
2answers
302 views

Capture piped multiline grep output into a variable

I'm using Zabbix's zabbix_sender.sh script to push exception stack traces to my remote Zabbix monitoring server. zabbix_sender.sh requires a key and a value for any data that it sends. It can read ...
6
votes
1answer
211 views

Providing normal users(non-root) with initialization and shutdown auto-run capabilities

I'm hosting an experimental/testing Linux box, running Debian Wheezy 7.4.0 distribution. Different users log into the machine over ssh to their accounts and are allowed to run the development tools ...
2
votes
4answers
240 views

Starting a script as another user

I've created a script in /etc/init.d/ which has to run several other scripts from other (non-root privileged) users from their home directories, as if they started them. I launch these scripts ...
0
votes
2answers
83 views

Finding a user's home from bash

I'm trying to get the value of a user's home from a puppet script. This particular user is a Samba user, not a local one, with the username of the form DOMAIN\user. I've tried the following, with no ...