所以我推出下面典型的nohup语法脚本:脚本打破当终端关闭,即使推出背景
nohup ./script &
下面的日志输出的一部分是,当我有一个临时的Internet连接显示什么和我的终端窗口锁定,迫使我手动关闭它们。当我的问题解决了我重新登录并查看日志的输出:
日志输出:(从results2.log)
--------------
UPDATE table where id between 45759776 and 55759776
--------------
Terminal close -- sending "KILL QUERY 3329619" to server ...
Terminal close -- query aborted.
Bye
--------------
脚本Conents:
#!/bin/bash
first=5759776
last=15759776
while [ $first -lt 73843165 ]; do
mysql -u -p??????? db -vvv -e "UPDATE table where pc.id between $first and $last;" >> results2.log
((first=first+10000000))
((last=last+10000000))
done
所以基本上有两个问题:
- 当我关闭终端时,为什么不在后台运行?
- 如何避免将来发生这种情况?
你想要做什么更新?在 –
中没有**设置字段= xx **问题不在于查询语法。我只是简化了日志文本。 – user3299633