nohup python main.py &
nohup python main.py 2>&1 &
nohup python main.py > main.out 2>&1 &
上面三種方式無論在nohup.out 或main.out都看不到數據結果,這是因爲python執行有緩存輸出。
解決:使用-u參數
nohup python -u main.py > main.out 2>&1 &
nohup python main.py &
nohup python main.py 2>&1 &
nohup python main.py > main.out 2>&1 &
上面三種方式無論在nohup.out 或main.out都看不到數據結果,這是因爲python執行有緩存輸出。
解決:使用-u參數
nohup python -u main.py > main.out 2>&1 &