Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda