bug-parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nohup bug


From: Mario Roy
Subject: Re: nohup bug
Date: Fri, 10 Feb 2023 22:44:01 -0600

If you find yourself in the same predicament as before with nohup, be sure to direct STDOUT and STDERR to /dev/null.

The following works in any POSIX-compatible shell.

    nohup parallel args ... >/dev/null 2>&1 &

Bash, Zsh, and possibly other shells provide a simpler way. Though, this is not portable if sharing your script.

    nohup parallel args ... &>/dev/null &



On Fri, Feb 10, 2023 at 10:26 PM zenon <zenon222@gmail.com> wrote:
I made my MCVE and executed it with nohup, the sample batch continued after the window was closed.  Whatever issue exists when using my complicated batch script I will probably never be able to isolate.
Thanks for writing parallel!! It has made increasing productivity so easy and reliable!

I'm using parallel for video encoding because I have a Nvidia card with NVENC and paralleling 8 processes nets about 5x quicker conversions....

Anyway, here's my sample code, maybe you want to add it as an example, I'm sure other people are like me and converting masses of jpg or video files:


## conversion.sh ##
#! /bin/bash

srcFile=$1
destFile=${srcFile%.*}".mkv"

ffmpeg -i $srcFile $destFile
## conversion.sh ##

## script.sh ##
#! /bin/bash

wget https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_5mb.mp4

cp big_buck_bunny_720p_5mb.mp4 001.mp4
cp big_buck_bunny_720p_5mb.mp4 002.mp4
cp big_buck_bunny_720p_5mb.mp4 003.mp4
cp big_buck_bunny_720p_5mb.mp4 004.mp4
cp big_buck_bunny_720p_5mb.mp4 005.mp4
cp big_buck_bunny_720p_5mb.mp4 006.mp4
cp big_buck_bunny_720p_5mb.mp4 007.mp4
cp big_buck_bunny_720p_5mb.mp4 008.mp4

find . -iname "*.mp4" | parallel -j 2 ./conversion.sh
## script.sh ##

On Fri, Feb 10, 2023 at 7:52 PM Shane Reimer <zenon222@gmail.com> wrote:
Ok. I just googled MCVE, I’ll make a code example.
Do you need copies of the .mkv files that would be processed too?

Sent from my iPhone

> On Feb 10, 2023, at 5:19 PM, Ole Tange <ole@tange.dk> wrote:
>
> On Wed, Feb 1, 2023 at 9:46 PM zenon <zenon222@gmail.com> wrote:
>>
>> Parallel does not work with the nohup command.  When the parallel command is executed with nohup new jobs will fail to execute once the window is closed.  Proper operation should be to continue with all commands.
>
> Please follow https://www.gnu.org/software/parallel/man.html#reporting-bugs
>
> Currently I have no MCVE.
>
> /Ole

reply via email to

[Prev in Thread] Current Thread [Next in Thread]