5

I run my script with this command

nohup python a.py > /var/log/a.log 2>&1&

This is okay but every time I run this command /var/log/a.log file is truncated. Is there a way to append this file no matter what?

previous_developer
  • 150
  • 1
  • 1
  • 5

1 Answers1

8

Try the below command to append the output as well as the standard error to /var/log/a.log file.

nohup python a.py >> /var/log/a.log 2>&1&

>>- Append

>- Overwrite

Avinash Raj
  • 80,446