Score:0

time nohup ./script --> the time hasn't been logged

li flag

I need to measure the time that Firefox takes to build itself from the source code. Here's what I do normaly:

nohup ./mach build > my_log.log &

I then prepended time to it:

time nohup ./mach build > my_log.log &

However, this hasn't made it generate any report about the time spent, at the end of the my_log file.

Why not? How to fix it?

djdomi avatar
za flag
I think you may need a 2&1 redirect
Romeo Ninov avatar
in flag
Have you try `nohup time ./mach build >my_log.log 2>&1 &`
uz flag
this might be smarter: `nohup time -o build.out ./mach build >my_log.log 2>&1 &` the output from `time` is in build.out/, ( or even add `--verbose` after the `-o build.out` )
Score:1
in flag

In your second attempt you measure the execution time of nohup command itself. So to get the build time you should put time after nohup:

nohup time ./mach build >my_log.log  2>&1 &

Also redirect the STDERR is good practice.

And as mentioned in comment you can have dedicated log for time command:

nohup time -o build.time ./mach build >my_log.log  2>&1 &
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.