The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
30 views

What is Best Practice for running PHP in background?

When running the following on the command line it will be suspended until I issue the fg command: /usr/bin/php -r 'phpinfo();' & This is the case regardless if the PHP code is contained in a ...
15
votes
5answers
36k views

How to stop a background process?

I have started a wget on remote machine in background using &. Suddenly it stops downloading. I want to stop its process, then start it again. How can I stop it? I haven't close its shell window. ...
2
votes
1answer
35 views

Right way of running a root task/program at background

I'm writing a program that needs to run at the background as root. (for any user) To do this I used the /etc/rc.local file. And it seems to work. The problem that I am experiencing is, when a ...
1
vote
1answer
30 views

Run a GUI application in background and reconnect later [duplicate]

Is there a way to run a Gui application (X11) in background so that if I disconnect, I can resume the running app again? I am using SmarTTY on windows to connect to remote CentOS. When I run a Gui ...
1
vote
1answer
27 views

Process id of a command ran by an user

Consider i am running just some basic command.. ls Now would the above command have a pid, when it was getting executed? If yes, then how can i determine that pid? when i try echo $! right ...
1
vote
1answer
57 views

How to run “&” operation sequentially

From my script I am running following commands: SCRIPT_1="ksh -x script1.sh & ksh -x script2.sh"; SCRIPT_2="ksh -x script3.sh & ksh -x script4.sh"; eval $SCRIPT_1; sleep 20s; eval ...
0
votes
1answer
23 views

Interactive shell in background inside another shell script

I have some problems when trying to run an interactive sh session inside a shell script. The inner sh process uses all the CPU and never terminates. To reproduce the issue simply create a file named ...
8
votes
1answer
253 views

Echoing progress from a background process without hijacking prompt

Consider the simple script hello: #!/bin/bash echo 'hello world!' Now from bash if I try to run this in the background: $ hello & [1] 12345 $ hello world! █ <--- prompt is stuck here until ...
2
votes
1answer
579 views

Python script run while screen is locked

I have a python script which seems to be failing to continue running its while True: ... sleep() loop my code is at http://github.com/xdaimon/xdaimonConky What happens is I autostart python on ...
10
votes
3answers
1k views

Is there any way to let it snow on my linux mint destkop?

I want snow fall on my desktop really badly. Tried Xsnow (with Mate/Marco, Mate/Compiz and KDE/Kwin) but doesn't work. Snow plugin for Compiz doesn't work anymore either. Snow feature of KDE was ...
0
votes
2answers
32 views

Creating background process and communicating with it

1st thing off, I am really a Linux newbie - knowing just some basics; there's a great chance I didn't know what I need to look for, please redirect me if you know a good source. What I'm trying to do ...
3
votes
3answers
977 views

Bash script needed to run every second

I have a few cleanup commands to run for my datacaching scheme. I was thinking a bash script would be an easy way to check if the full clean up job needed to be run. But the cache is very time ...
4
votes
5answers
266 views

Calling multiple bash scripts and running them in parallel, not in sequence

Suppose that I have three (or more) bash scripts: script1.sh, script2.sh, and script3.sh. I would like to call all three of these scripts and run them in parallel. One way to do this is to just ...
1
vote
2answers
47 views

Store stdout in variable and send command to background

I have a command in a bash script which I want to capture the output of and then send it to the background. How do I get this done? The following doesn't seem to work (it keeps blocking and outputs ...
4
votes
2answers
124 views

Why does my Python background process end when SSH session is terminated?

I have a bash script that starts up a python3 script (let's call it startup.sh), with the key line nohup python3 -u <script> &. When I ssh in directly and call this script, the python ...
-2
votes
1answer
33 views

Using semicolon to separate a background job from the following one? [duplicate]

Can we use semicolon to separate a background job from the following one? $ nohup evince tmp1.pdf &; nohup evince tmp.pdf & bash: syntax error near unexpected token `;'
0
votes
2answers
76 views

how to run rm in background in terminal

I have the following command to delete files in a folder that are 15 days or older: find /var/www/App/app/var/sessions* -mtime +15 -exec rm {} \; what is the best way to speed this up and run it ...
5
votes
4answers
351 views

When I run `./command.sh &` the background task is suspended. How can I keep it running?

This is what I'm running: alexandma@ALEXANDMA-1-MBP ./command.sh & [2] 30374 alexandma@ALEXANDMA-1-MBP [2] + suspended (tty output) ./command.sh I don't want it suspended to start, I want it ...
0
votes
1answer
32 views

Background a process and execute something with one command

Probably it would be easier to do just with a script, but I wonder why can't I do that with one command. What I have tried so far: $ (ls >/dev/null &) && echo $! 3135 $ (ls ...
0
votes
2answers
32 views

How to launch «gdbserver» in background?

I am communicating with a device via a serial port, and for I am launched «gdbserver» (like gdbserver :2345 myapp) it completely blocks the terminal. Neither an ampersand & symbol, nor ^z ...
26
votes
3answers
36k views

How to suspend and bring a background process to foreground

I have a process originally running in the foreground. I suspended by Ctrl+Z, and then resume its running in the background by bg <jobid>. I wonder how to suspend a process running in the ...
3
votes
3answers
1k views

How to bring back SSH session that was started with the -f option (run in background)

I'm pretty lost on this. From the man page: -f Requests ssh to go to background just before command execution. After starting SSH with the -f option, I have a working tunnel. But after I ...
1
vote
1answer
69 views

Start a background process from a script and manage it when the script ends

I'd like to run and configure a process similarly to a daemon from a script. My shell is zsh emulated under Cygwin and the daemon is SFK, a basic FTP server. For what matters here, the script ...
2
votes
0answers
45 views

SSH fork kills connection

I am using a linux script which has the task of forwarding control of the system to remote support. In this script one of the commands is a ssh port forward command that will forward the port of the ...
1
vote
2answers
65 views

What is/are the advantage(s) of running applications in backgound?

I really don't know what are the advantages of running applications in the background. Something like Application & via command line. Why exactly do we run applications in background and when ...
24
votes
4answers
2k views

What's the difference between running a program as a daemon and forking it into background with '&'?

What are the practical differences from a sysadmin point of view when deploying services on a unix based system?
1
vote
1answer
84 views

Can't spawn backgrounded process

My team's using Pallet (think Puppet in Clojure) to automate server provisioning, but running into a fairly fundamental problem: Pallet can execute arbitrary scripts directly on target VMs, but if one ...
2
votes
0answers
59 views

Open a program (VLC) and move it to the foreground

On a Mac, specifically, when I use the VLC command line to open a video file, it opens in the background by default. How can I instead move it to the foreground whenever I run the command to open a ...
3
votes
4answers
368 views

How to return a background task to be in the foreground?

Well, the title does not say much, but I would like to know how to stop a running process after appending it with &. For example, I would like to install software foo. Now, assume, foo has many ...
3
votes
2answers
133 views

Interacting with a running interactive console program from a different process

I have a console program with an interactive shell, similar to say, the Python interactive shell. Is there an easy way to start this interactive program A and then use another program B to run A? I ...
0
votes
4answers
194 views

How to get process id of a command

We are running some command in batch mode. We need to do some more tasks once the existing command is done, so we need to wait until this command is done. For example: bsub -q gui -I calibre -drc ...
3
votes
1answer
190 views

Adding wallpapers in GNOME Shell

When executing Activities → Settings → Background, you can find three background tabs: [Wallpapers] [Pictures] [Colors] In [Wallpapers] you can find backgrounds under /usr/share/backgrounds/, but ...
0
votes
1answer
28 views

Background Process not running?

I ran a C program with an infinite while loop in a terminal and observed one of the CPU cores shot to 100% usage. When I turn it into a background process using Ctrl+z, the CPU usage suddenly dipped ...
2
votes
1answer
73 views

Trying to achieve fake transparency in Urxvt - can only get a black background?

I'm trying to achieve a (fake) transparent gray background in my URxvt (rvxt-unicode) terminal emulator. Doing this using composite transparency works as it should, but I can't get it to work using ...
1
vote
1answer
127 views

Explanation for background tasks on bash

First, I write a simple PHP script <?php while(true) { echo 'hey'.PHP_EOL; sleep(1); } Then I run it like: php test.php & Obviously goes into background, but keeps running and ...
1
vote
1answer
43 views

Can I start a background process with a specific working directory?

Say I have this structure /masterscript /a/script1 /a/b/script2 In masterscript I spawn the other scripts as background processes: "/a/script1" & "/a/b/script2" & The problem is that ...
0
votes
0answers
24 views

How to make the process run after closing the session [duplicate]

I have started a process in Linux without a terminal multiplexer like screen or tmux, without nohup. Now I want to logout from my remote ssh session without interrupting the execution of that process. ...
79
votes
6answers
49k views

How can I close a terminal without killing the command running in it?

Sometimes I want to start a process and forget about it. If I start it from the command line, like this: redshift I can't close the terminal, or it will kill the process. Can I run a command in ...
1
vote
2answers
70 views

Call background process back to stdout

Is it possible to "call" a background process output to be shown in the terminal? Example: cron starts apt-get to update the system and I want to see the output of apt-get
4
votes
0answers
122 views

How do I execute in background / return early?

For reference, I'm using phpseclib to control a remote SSH server using the 'root' account. I have to start/stop a java process which is ran in the background. Stopping works fine with killall java ...
6
votes
5answers
3k views

How can I run `watch` as a background job?

When I run: watch 'cmd >> output.txt' & the job gets suspended by the system: 3569 Stopped (tty output) Is there a workaround?
24
votes
4answers
5k views

How to do nothing forever in an elegant way?

I have a program which produces useful information on stdout but also reads from stdin. I want to redirect its standard output to a file without providing anything on standard input. So far, so good: ...
14
votes
7answers
37k views

Execute remote commands, completely detaching from the ssh connection

I have 2 computers, localpc and remoteserver. I need localpc to execute some commands on remoteserver. One of the things it needs to do is start a backup script that runs for a number of hours. I ...
3
votes
1answer
42 views

Is there an easy way to background a sudo shell?

A bit more details, what I'm looking for is some kind of ^Z for sudo shells. For instance when running a long command I can hit ^Z to suspend the command or when I do ~^Z in ssh after hitting Enter. ...
8
votes
4answers
873 views

I am using `&`: why isn't the process running in the background?

I know that I can append & to a command to run the process in the background. I'm SSH'ing into an Ubuntu 12.04 box and running a python program with $python program.py & -- but when I go to ...
4
votes
3answers
3k views

Permanent background ssh connection to create reverse tunnel: what is correct way?

Related question: initiate ssh connection from server to client Answer from there helped me a lot, this command does what I need: ssh -R 2225:localhost:22 loginOfServerWithPublicIP@publicIP So I ...
1
vote
1answer
78 views

getting pid of two last commands executed in background and do stuff

I wrote this bash: #!/bin/bash eval "(a command) &" pid1=$! eval "(while kill -0 $pid1; do .... ; done) &" #It creates file.txt after few seconds pid2=$! if [ -s ...
0
votes
4answers
6k views

Can't set background wallpaper in Gnome 3

I am using Debian Testing and Gnome Flashback (but it behaves the same in standard Gnome Shell). It gives me plain white background, and I can't set my own. Also, the settings dialog for background ...
3
votes
2answers
93 views

What environment and credential is used by startup, background and service processes

Startup scripts (on boot) Processes running in (or sent to) the background (when using SSH -fN for example) Services etc... What $path variable will they be using? What credentials? Anything else I ...
6
votes
2answers
1k views

what will ¬ do in bash?

While wanting to start gitg as backgrounded through writing gitg & I accidentally typed gitg ¬. This did not cause an error, instead I got with a later command in the same terminal (translated): ...