Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
Accidentally failing command in linux

I have server and connect to it via ssh, I would like to run command and then disconnect from server thinking, that process is running and will be finished in few hours. So I came up with

python script.py > output.txt 2^C1 & 

it works! ... well sometimes .. and sometimes (exactly the same python script) it fails without leaving any error msg in output.txt. Does anyone know why? And what should I be running to prevent failing?

I doubt that it has something to do with python script.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You're probably looking for nohup.

nohup python script.py > output.txt 2^C1 &

It allows you to logout with the script still running.

over 4 years ago · Santiago Trujillo Report

0

It won't leave any error message in output.txt, Try this

python script.py 1> output.txt 2>error.txt 2^C1 &

If your script fails it should log reason in error.txt

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!