Questions tagged [nohup]
The nohup standard utility and the nohup builtin from shells like csh, which cause the SIGHUP signal to be ignored
276
questions
0
votes
1
answer
24
views
How Can I Add Dates To Nohup Log Files Lines
I'm running python on my server. I want to add date and time info to my nohup log file's lines.
Log file content similar to what I want to do (inside log file):
09/09/2023 07:13 Traceback (most recent ...
0
votes
0
answers
26
views
how to put an existing process into an interactive shell's foreground [duplicate]
Say I started a long running process with nohup. As predicted, I close the current shell session. I open a new one and then I would like to add the still running process to the foreground (or to the ...
0
votes
0
answers
27
views
Why does bash send SIGTERM to program after logout despite setting nohup and disown
I want to run a program which continues after logout from an ssh session.
I've tried:
nohup myProg > /tmp/logfile 2>&1 &
disown %1
and
systemd-run --scope --user myProg -p > /tmp/...
0
votes
1
answer
46
views
nohup inside a script, started with at
I want to run a postgres dump from a remote server which will take a couple of hours.
I am using a bash script on the target to do so and start it with at
Now, in order to prevent things from breaking ...
0
votes
0
answers
65
views
Continue running on remote linux server in an conda environment
I am working in a conda environment and want to keep running after my disconnect. Normally, I use nohup for this purpose but is it possible to use nohup in a conda environment?
nohup bash program.sh ...
0
votes
1
answer
265
views
Can I use nohup in a conda environment?
I should run a program in a conda environment in a remote linux server connected via ssh, which takes really long. Can I use nohup so I can logout? Will there occur any problem due to conda ...
0
votes
1
answer
41
views
nohup process pid not visible in new shell but still in old shell
I open and connect an ssh terminal window shell to my server and run this:
nohup sleep 50000 &
When I then run ps I see this:
PID TTY TIME CMD
1 ? 00:00:00 bash
56 ? ...
-4
votes
1
answer
192
views
Nohup doesn't work with my Windows syntax from WSL2
I am running Tiddlywiki as portable from OneDrive, following this tutorial.
I am running this from WSL2:
cd /mnt/c/Users/mobil/OneDrive/node && nohup cmd.exe /c tiddlywiki.cmd mynewwiki --...
0
votes
1
answer
107
views
How to NOT append nohup output to a file but replace it?
Lately I needed to be able to run a script in the background and monitor its output from another machine. For this reason I was able to use this command:
$ nohup ./rsync.sh > ./output.txt
This is ...
0
votes
1
answer
44
views
Run a command in background and independent of terminal and run alternative if fails
Goal: To run a command independent of the terminal and return immediately. And if the command fails run an alternative commands independent of the terminal and return immediately.
I did the following. ...
0
votes
1
answer
2k
views
What does the error stty: 'standard input': Inappropriate ioctl for device Can't obtain kerberos tickets mean?
I ran the command:
nohup sh -c "echo $SU_PASSWORD | /afs/cs/software/bin/reauth; python -u ~/diversity-for-predictive-success-of-meta-learning/div_src/diversity_src/experiment_mains/...
1
vote
2
answers
767
views
Bash script to start java spring boot application from SSH
I have a simple bash script file, which is triggered from pipeline job ( via SSH ).
The deploy.sh contains more or less something like this:
cd /apps && java -jar "-Dspring.profiles....
0
votes
1
answer
60
views
Mistakenly started a long running task on an ssh shell
I understand that a long-running job on a server should be started with nohup/screen/tmux. But sometimes by mistake, I will start a job w/o realizing how long it would take. For example, I recently ...
2
votes
1
answer
330
views
How does one send new commands to run to an already running nohup process or run two commands together/concurrently in nohup?
I want to run a nohup job and to that already running process run a specific new command (e.g. kerberos authentication). In fact the ideal solution would be to first run the reauth command and then ...
0
votes
2
answers
617
views
How do I wait for a process to end and then do a series of actions (e.g. kill a tmux session) without blocking my main terminal?
I am trying to "re-implement" nohup inside of tmux (so dispatching a job without blocking me and then killing the tmux command acting as nohup). My attempt is here (and it has several issues ...
1
vote
1
answer
58
views
How to run the follow sample in own process or processes?
The Environment is a Linux like Debian or Ubuntu.
I have two examples; one is working fine, the other is not. How can I fix the non working one?
First example:
Here, I run commands in a terminal to ...
1
vote
1
answer
305
views
Redirect output of nohup in a .sh file doesn't work properly
I want to run a lot of python scripts and save their outputs. Because running one by one in terminal is too cumbersome. As suggested, I decide to use a shell script (.sh).
To simplify the problem, let'...
2
votes
3
answers
841
views
Execute several scripts at the same time with nohup
I want to execute four scripts at the same time with nohup. These scripts are all in the same folder.
Would something like this work?:
nohup /.scrip1.sh & /.scrip2.sh & /.scrip3.sh & /....
0
votes
0
answers
178
views
nohup bash function
In my .bashrc:
function keepassxc(){
"/Applications/KeePassXC.app/Contents/MacOS/KeePassXC" "${@}"
}
export -f keepassxc
From Terminal:
$ nohup keepassxc
nohup: ignoring input ...
0
votes
1
answer
1k
views
nohup: can't execute 'display_files.sh': No such file or directory
I want to run my code with
nohup shellskriptname &. But whenever I try to see the nohup, it says there is no such file. What can I do, so I can enter it like that?
#!/usr/bin/bash
# To Display ...
0
votes
0
answers
264
views
"nohup python3 .. &" ends once I disconnect from a server
This command
nohup python3 main.py > my_log.log 2>&1 &
will end once I disconnect from a server. That is, if I disconnect and then connect 10 seconds later, the task, or a job, will be ...
0
votes
0
answers
65
views
Why does Neovim behave differently from Geany when launched with nohup and &?
When I open Geany I need to launch it with nohup, e.g. nohup geany test.txt & so that when I close my shell,
from which I launched it Geany does not get closed. I noticed that this is not the case
...
1
vote
0
answers
120
views
Multiple Scripts all in one with breaks [closed]
I’m writing a script where instead of using ‘sleep 600’ (for example), i actually want to execute another script for the same amount of time as sleep.
So basically, instead of “doing nothing” for 10 ...
0
votes
1
answer
575
views
why websocat or wscat in background with nohup, disown, bg, &, &! don't work
The question is about running a bash script in background with the ability to logout and the process to continue. The issue is that websocat and wscat don't like when I close the terminal or logout.......
0
votes
2
answers
537
views
When a program/process is started in bash without nohup, is it later possible to let this program run even after the shell/terminal is closed
When a program/process is started in bash WITHOUT nohup, is it later possible(do something further) to let this program run even after the shell/terminal is closed.
Here is a great discussion on ...
1
vote
1
answer
640
views
How do I use SSH to launch a nohup ffmpeg command and leave it running after disconnect?
I'm trying to launch a series of FFMPEG commands over SSH. My SSH client is the native openssh (7.7.2.1) client in Windows Server 2019 (ver 1809 build 17763.2114). The command I am trying to run is ...
0
votes
1
answer
354
views
Running nohup many times in a script
Related to an earlier question I asked here. So I have the following script:
requests=(25 50 75 100)
factors=(3 6)
graphsizes=(25 50 75)
for request in "${requests[@]}"
do
for factor in &...
0
votes
1
answer
254
views
How to run this simple command in the background
I am having a really hard time trying to run the command below on the background:
find /dir -iregex ".*\.\(jpg\|jpeg\)" -exec jpegoptim --strip-all {} \; -exec sleep 1 \;
I tried adding ...
0
votes
1
answer
120
views
Oracle Linux 6.7 - Nohup: Argument list too long
There are 1 million directories and some files in directories (.pdf, .csv etc.) under the path I have specified below:
/data/upl/repo/exp/
I want all files and folders older than 1 year to be deleted,...
1
vote
2
answers
16k
views
Can not stop nohup process
I am trying to run a very complex statistical model that I expected to take a very long time, so I used nohup to run the process. However, I underestimated the length and it would take like 260+ days ...
1
vote
1
answer
2k
views
Dynamic changing PID - nohup process not killable - Linux
I have started a python script by following:
nohup python src/myscript.py &
Now there is a process running, where the PID is changing constantly, so it is absolutely not possible to kill it. When ...
1
vote
0
answers
321
views
Not able to run a nohup script inside a ksh
I'm trying to read a text file (containing set of instructions)
#!/bin/ksh
INPUT=input.txt
OLDIFS=$IFS
while IFS='~' read -r ACTIVE process_name PATH STOP START DB
do
if [ $ACTIVE == 'Y' ]; ...
3
votes
2
answers
4k
views
How to run a sudo process using nohup?
How can I run a sudo command using nohup? I want to execute a sudo command and then terminate the ssh session but without interrupting or stopping the process.
I tried this but it doesn't work
sudo ...
0
votes
0
answers
636
views
NOHUP stopped working
I've been using nohup for years on my server without any issue. Suddenly today it stopped working and the process ends as soon as I exit SSH. I have multiple accounts on this server and the problem is ...
0
votes
1
answer
134
views
How to add nohup jupyterhub in service
Have installed jupyterhub locally. for starting it I'm using this command
conda activate jupyterhub_environment and then
nohup jupyterhub
how to add this commands in service so that it can start ...
2
votes
1
answer
510
views
Script called with nohup dies sometimes when calling script exits
I wrote a little bash script showing a screenshot menu (screenshot-menu.bash):
#!/usr/bin/env bash
echo 'Select an option:
s whole screen
w active window
r select region
'
read -rsn1 key
sleep 0.1
...
0
votes
2
answers
2k
views
Keep python script running after ssh closed
I am trying to run a script called script.py on a remote CentOS 7.3 box that I ssh into. I am running the script from an environment called py. I want the script to continue running after I disconnect....
-1
votes
1
answer
1k
views
What is the difference between nohup and crontab? [duplicate]
Say I want to delete the contents of a directory every hour, what is the difference between having let's say a python script do this for me: nohup python dir_cleaner.py & vs setting a cronjob to ...
0
votes
1
answer
693
views
How to send "enter/any key" signal when using nohup?
For example, I've executed a script using nohup and & to put the script execution in background, and in some step the script ask me to do something else to be able to continue the current ...
1
vote
1
answer
4k
views
nohup ends when I close the SSH terminal and doesn't show up on ps/job when running
I have an AWS EC2 Ubuntu 20.04 instance, accessed via puTTY SSH. Running a Python process via OpenMPI through the following command on non root:
nohup mpirun python3 job.py
When the shell is open it ...
2
votes
0
answers
127
views
Using nohup and & on remote Mac OS X causes process to become idle?
I am running some code on a remote server (an iMac), and I want the process to keep running after I log out.
So, I am using nohup and &. However, the process becomes idle when I leave (log off) ...
0
votes
1
answer
182
views
starting Python IDLE with setsid or nohup requires a sleep
A bit of context: I am creating a small Python programming lab for novice users. I want them to use Python's IDLE editor (which you launch as python -m idlelib) but since they may not be comfortable ...
4
votes
1
answer
1k
views
How to limit the number of background process in Unix
I have to run a script in 100 parts while making sure that only 10 parts run at parallel at any point of time.
Below script will trigger all the 100 processes at the same time :-
for i in {1..100}
do
...
0
votes
1
answer
706
views
sudo error when using nohup to run programs in the background
I have a simple exec running in my terminal to run program.py in the background using nohup. Here is the script:
cd "$(dirname "$0")"
sudo -v
nohup sudo python3 program.py &
...
0
votes
2
answers
2k
views
Bash Creates Child Process Using && and not with ; for a nohup programm
I have a macbook (default shell is zsh)
I have an executable python script (srcript1.py).
I use another executable script (called starter) that runs script1.py when my computer starts, the terminal ...
1
vote
1
answer
1k
views
How to use the nohup command properly in a custom script
I have a script that allows me to perform a number of automated tasks. At the end of the script, I run the following command:
nohup ./MyServer &
This command launches in the background my server ...
1
vote
0
answers
246
views
When i use nohup command..Are nohup exit codes same as script return codes
I am using below command in one script
abc. Sh
Nohup script1.sh $tablename &
This script1.Sh passes some returncodes based on success/fail
Ex:0-success
99fail
When I use exitstatus=$? .. Will this ...
1
vote
1
answer
390
views
nohup won't show next prompt in SSH session
Assume that I am connected via SSH on a remote Ubuntu system. I want to execute a script there using nohup in case of potential connection drops and redirecting its log to a file. The command I run is
...
1
vote
0
answers
141
views
Why is `nohup` necessary
I have to start a rather long duration script (it can run for half an hour or more) through SSH, and collect its StdOut/StdErr and return code.
I want to avoid waiting for the process end in the same ...
0
votes
0
answers
1k
views
How to kill a Python process within an SSH session
This question involves running a bash script, say helloworld.sh, which executes an MPI mpirun command which in turn runs a Python program, say helloworld.py, using mpi4py. The bash command is used in ...