Sponsored Content
Top Forums UNIX for Advanced & Expert Users Send current script to background Post 302995105 by MadeInGermany on Friday 31st of March 2017 02:27:19 PM
Old 03-31-2017
A block in parenthesis can be sent to the background
Code:
(
while true; do
    echo "doing some never ending daemon stuff" > log
    sleep 5
done
) </dev/null >/dev/null 2>&1 &

It is safer to disable stdin,stdout,stderr. E.g. the sleep command could try to set a CTRL-C interaction from the terminal.
This User Gave Thanks to MadeInGermany For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

send characters to current window

Before I re-invent the wheel... I have written an on-screen keyboard & handwriting input client in Java (spare me please, I get paid to write Java and it will take some time to get back up to speed in C & X11). In order to concentrate on the other bits, I took advantage of a hack... (0 Replies)
Discussion started by: bcw
0 Replies

2. Shell Programming and Scripting

Send password : In Background

Hi All, How to pass the password in background.....? " /usr/bin/hdiutil attach -mountroot -stdinpass /path/to/mount/ /path/of/image/TEST.sparseimage " The above command asks the password to mount a sparse image and when supplied it gets mount. But my requirement is to use... (1 Reply)
Discussion started by: ashwin.patil
1 Replies

3. UNIX for Advanced & Expert Users

send a new value to a variable in a running background process

Hi guys, I have a issue with a background process, I need to update the value of a variable in that process which is running at this time and it will be running for at least 2 days. Any idea? I will apreciate your help. regards. Razziel. (2 Replies)
Discussion started by: razziel
2 Replies

4. Shell Programming and Scripting

Send Foreground job to background redirecting output

I have many CPU intensive processes running and sometimes I run them in the foreground so that I can see what the output is. I want to send that foreground process to the background, but also have it direct the output to a logfile. I know to send something to the bg I do Ctrl-z on the FG... (6 Replies)
Discussion started by: jhullbuzz
6 Replies

5. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

6. UNIX for Dummies Questions & Answers

Send job to Background after input redirection

Hi, I am having issues with syntax when I am trying to send a job to the background after a input redirection. I have this script which sends some files to different servers after zipping them. Once I execute it, it will ask for user input as of which server the files need to go to. (The... (3 Replies)
Discussion started by: grep_me
3 Replies

7. Shell Programming and Scripting

Perl to send previous and current value

For example, I have a file called number.txt. x y 1 1 2 4 3 9 4 6 5 5 6 6 7 9 8 4 9 1 10 0 ... And I want to print out the value of x and y, if y%4==0 and the next value of y%4==0. Thus, the sample output is: 1 1 *because the previous x before 2 is 1 2 4 *because 4%4 == 0 7 9... (2 Replies)
Discussion started by: Tzeronone
2 Replies

8. UNIX for Dummies Questions & Answers

How do I send output of a background process to a file other than nohup.out?

I have a question. I will be running a background process using nohup and & command at end. I want to send output to a file say myprocess.out. So will this command work? nohup myprocess.ksh > myprocess.out & Thanks in advance guys !!! :) (3 Replies)
Discussion started by: vx04
3 Replies

9. Shell Programming and Scripting

Send sleep to background

Hello all, I've a small script where it checks for the existence of a particular file and sleeps for 5 seconds if it doesn't exist. I would like to send the sleep output to background so that I don't see so many sleep messages in the build output. #!/bin/sh -x until do sleep 3 done echo... (17 Replies)
Discussion started by: builderj
17 Replies

10. Shell Programming and Scripting

How to send a file in UNIX through email which is created only 15 minutes before the current time?

I wanted to send an email to the client whenever there is failed record created in a /feed/HR-76/failed folder after processing of feed file. I can find out with the help of below script that what is the new file created but that file didn't make just 15 minutes before. ... (1 Reply)
Discussion started by: puneetkhullar
1 Replies
SOLARPOWERLOG(1)														  SOLARPOWERLOG(1)

NAME
solarpowerlog - queries data from a photovoltaic inverter SYNOPSIS
solarpowerlog [options] DESCRIPTION
The program trackd and logd data from photovoltaic inverters, collect power data and store them. OPTIONS
The program follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -h, --help Show summary of options. -v, --version Show version of program. -b, --background Runs the program in the background, detaching it from the console. -c, --conf filename The configuration to be used. Default is solarpowerlog.conf, looked for in the current directory. --dumpcfg Dump configuration structure, then exit --chdir arg working directory for daemon (only used when running as a daemon). Defaults to / --stdout arg redirect stdout to this file (only used when running as a daemon). Defaults to /dev/null --stderr arg redirect stderr to this file (only used when running as a daemon). Defaults to /dev/null --pidfile arg create a pidfile after the daemon has been started. (only used when running as a daemon). Default: no pid file SEE ALSO
http://sourceforge.net/apps/mediawiki/solarpowerlog/index.php June 16, 2009 SOLARPOWERLOG(1)
All times are GMT -4. The time now is 03:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy