the code that can send email in linux server
I often encounter a recurring issue when running projects on a remote server and trying to collect data afterward. The setup in my run_script.sh usually includes a line for sending emails once the job is done. #!/bin/bash #BSUB -J StockTraderTestRun # Set the job name to StockTraderTestRun #BSUB -q gpu # Submit to the long queue #BSUB -o /nfsshare/home/tang/StockTrader/%J.out # Standard output file #BSUB -e /nfsshare/home/tang/StockTrader/%J.err # Standard error file #BSUB -N # Send email at job finish #BSUB -u ariana_tang@outlook.com # Set your email address # Change directory to where the main.py script is located # Execute the main.py script cd /nfsshare/home/tang/StockTrader/StockTradingDRL_upload/ python /nfsshare/home/tang/StockTrader/StockTradingDRL_upload/main.py novel_lstm_positive But here’s the rub: the email dispatch never functions as intended. There’s a subtle irony in how my efforts to debug are commensurate with the perceived benefits of receiving an email notification post-job completion. Admittedly, I’ve been somewhat negligent, routinely plugging in the line #BSUB -u ariana_tang@outlook.com # Set your email address and occasionally altering the address, half-hoping for a spontaneous fix. ...
