Ankit Solanki
Ankit Solanki

Reputation: 680

Linux: Daemon and Daemon output to be logged in a file

I am using the below command to run my python code as a daemon on the server.

nohup python mycode.py >> log.txt 2>&1 &

For some reason unknown to me only few lines are getting written to the file.

Thanks in advance

Upvotes: 0

Views: 303

Answers (1)

Rahul R Dhobi
Rahul R Dhobi

Reputation: 5806

nohup itself writing output in nohup.out so no need to redirect output to log.txt,bydefault all output will be redirected to nohup.out

Upvotes: 1

Related Questions