Execute the nohup sh script through the bastion machine to report an error

a problem description

I wrote a script to import data into mysql (mysql -u root < sql file), and then used nohup to call this script, but the result was an error:

 Change the data import script to source (mysql -u root -e "source sql file" also reports an error:

 Two solutions

Use screen.

Execute the screen command to open a new window, execute the nohup data import script in the new window, and then press ctrl+a+d to exit the session. After looking at the log, there is no error report

--Common screen commands

--If screen:command not found is prompted, you need to install it with yum install screen

Guess you like

Origin blog.csdn.net/YABIGNSHI/article/details/130634593