首页 > 其他 > 详细

linux如何将一个正在运行的进程转入到后台执行

时间:2014-02-07 03:30:18      阅读:491      评论:0      收藏:0      [点我收藏+]
要求:将一个正在当前前台执行的进程转入后台执行,并且要求退出shell后依然保持不退出进程。
  1. ctrl+zto stop (pause) the program and get back to the shell

  2. bgto run it in the background

  3. disown -h [job-spec]where [job-spec] is the job number (like%1for the first running job; find about your number with thejobscommand) so that the job isn‘t killed when the terminal closes


操作如下:
[root@dispatch_19 gcc-4.8.1]# cd /home/machen/vv_cold_algorithm/movie_score_builder && /usr/local/bin/python view_record_manage.py save 1
13-12-28 13:50:49 ./logs/view_record.log INFO   start calculate delta data
13-12-28 13:50:49 ./logs/view_record.log INFO   hdfs:/data/dm/recommend/recom_yvv/20131227
first fresh...


ctrl+z
[1]+  Stopped                 /usr/local/bin/python view_record_manage.py save 1
[root@dispatch_19 movie_score_builder]#bg
[1]+ /usr/local/bin/python view_record_manage.py save 1 &
[root@dispatch_19 movie_score_builder]#jobs
[1]+  Running                 /usr/local/bin/python view_record_manage.py save 1 &
[root@dispatch_19 movie_score_builder]# disown  -h %1


linux如何将一个正在运行的进程转入到后台执行

原文:http://lonelyprogram.blog.51cto.com/6246243/1355257

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!