Questions tagged [pipe]

157 questions
2
votes
2 answers

Bash Parallelization of CPU-intensive processes

tee forwards its stdin to every single file specified, while pee does the same, but for pipes. These programs send every single line of their stdin to each and every file/pipe specified. However, I was looking for a way to "load balance" the stdin…
ehsanul
  • 427
  • 1
  • 8
  • 19
2
votes
4 answers

Is there an easy way to insert data/time in front of a log file with just shell scripting?

Say I want to monitor memory usage on a java process overnight. I can do something like top | grep java > out.log I will get a log file with a whole bunch of lines. Is there an easy way to get a data/time inserted in front of each line?
James Dean
  • 801
  • 1
  • 7
  • 5
2
votes
2 answers

Non-blocking bash redirection

Does anyone know how to redirect the output of a program, running from a bash script, to a named pipe IN NON BLOCKING MODE (having 'O_NONBLOCK' flag set)?
anderson
  • 301
  • 4
  • 7
2
votes
2 answers

Pipe email from google apps to server php script

I'm wondering if anyone here would have any ideas on how I can pipe support@domain.com to our ticket system on our server with our email being hosted via Google Apps. Is it possible to pipe a specific email address via DNS?
Ben
  • 3,800
  • 18
  • 65
  • 96
2
votes
2 answers

Is it possible to pipe qemu-img into SSH target?

I tried the following command, but only an empty file is created on the target and the command stays open qemu-img convert -f raw -O vmdk /dev/sda1 - | ssh foo@bar "cat > /home/foo/foobar.vmdk" Note: sshfs is not available.
mgutt
  • 503
  • 1
  • 7
  • 24
1
vote
1 answer

Mysqldump to compressed file

Situation: 1. mysql is backuped to disk with mysqldump (~250 GB) 2. dump is compressed with bpzip2 3. dump is moved to another DC 4. disk usage again in good state Problem: Filesystem usage peaks, example: I need 1 TB space to fit the data while…
1
vote
2 answers

Send email if script outputs string

I found this line: sh script.sh | grep 'NO' 2>&1 > grep.log && /usr/bin/mail -s "grep found something" m@mail.com < grep.log which will write the output of script.sh to grep.log and then email that to an email m@mail.com Is there anyway to remove…
Kohjah Breese
  • 171
  • 2
  • 13
1
vote
3 answers

How to compress spaces in bash command output?

I work on a small screen and I'm trying to make the output of this command shorter, but I cannot get it to work. Command: docker container ls --all Output (too wide!): CONTAINER ID IMAGE …
noctonura
  • 453
  • 1
  • 4
  • 10
1
vote
0 answers

dovecot/postfix/postgres and piping mail to script

I'm trying to pipe mail to script I added lines like these to /etc/postfix/master.cf: myscript unix - n n - - pipe flags=F user=root argv=/var/myscript/igotmail.sh ${sender} ${size} ${recipient} smtp inet n - - - - …
zekorius
  • 11
  • 1
1
vote
0 answers

Read named pipe as output to echoing to a pipe

I've created a few named pipes for a few client programs such as cec so I only need to make the connection once in the background and just pipe in commands. Most of the time I don't need to read the output but I need to sometimes and would like to…
Jason
  • 11
  • 2
1
vote
3 answers

Bash piping answer in Ubuntu

In a bash script, I want to know know how to pipe in answers like for example: ssh -l username -i /home/ubuntu/.ssh/id host.com < yes The ssh connection would ask if I would like to continue the connection and I want to pipe in the answer yes…
UbuntuUser
1
vote
1 answer

Can I filter output from `tail` with the `-f` flag?

I'd like to tail -f the output of access_log on RHEL 6.8 but pipe and grep that output to act as a filter. Is there such an option? That is I'd like live output from: # tail -f error_log | grep <> Currently I'm doing something…
Rick
  • 299
  • 1
  • 4
  • 12
1
vote
1 answer

gzip piped output into ssh command

I make backup over ssh like this: mysqldump -u dbuser -pXXXXXXXX dbname | ssh -i ~/.ssh/id_rsa_backup backup@my.server.com 'cat > /var/backups/services/my_service/db/$(date +"%Y-%m-%d").sql' How to send gziped data to save bandwith and disk space ?
bux
  • 626
  • 2
  • 6
  • 20
1
vote
1 answer

How do I pipe stdout and std error to a file and back to stdout on Windows?

On Windows when running a batch script I want to record the output of I run: myprogram.bat 1> mylog.log 2>&1 Which is great - but I have to run a separate tail process to read the output in another window. What I want is to be able to record it to…
Hawkeye
  • 2,699
  • 9
  • 30
  • 35
1
vote
1 answer

How to ask exim4 to redirect some email pattern to a specific email address?

I would like to redirect all email from *@domain.fr to username@gmail.com Do you know how I can configure my exim4 server on Debian to do so ? (My exim configuration seams to be split in different files) Thank you.
Natim
  • 626
  • 1
  • 6
  • 16