后台执行 scp
2016-12-10 18:53
381 查看
man nohup
nohup - run a command immune to hangups, with output to a non-tty
nohup就是不挂起的意思( no hang up)。
nohup command > myout.file 2>&1 &
在上面的例子中,
0 – stdin (standard input),1 – stdout (standard output),2 – stderr (standard error) ;
2>&1是将标准错误(2)重定向到标准输出(&1),标准输出(&1)再被重定向输入到myout.file文件中。
在后台运行 scp
1.
nohup scp user@server:path/file localpath
2.输入密码
3.按Ctrl+z挂起当前进程
4.使用命令bg让挂起的进程继续运行
compile_time=`date +%Y%m%d%H%M%S` nohup scp /root/test/wars/test/$compile_time/*.war root@113.111.111.111:/root/softs/temp/wars > /root/myscript/test.out 2>&1
或
compile_time=`date +%Y%m%d%H%M%S` nohup scp /root/test/wars/test/$compile_time/*.war root@113.111.111.111:/root/softs/temp/wars
相关文章推荐
- scp通过key后台执行命令
- 后台执行scp命令
- linux scp后台执行
- Linux中后台执行scp
- 【Linux笔记】在后台执行scp,实现服务器间无密码文件拷贝。
- scp命令后台执行方法(Run Background)
- Linux中后台执行scp
- scp后台执行的方法
- linux 后台执行scp
- Linux Shell脚本中,远程调用脚本或命令,并使后台执行
- linux后台执行jar
- 脚本不输密码执行scp命令(需要expect和send命令)
- c# 后台代码注册 js 脚本并执行
- [VB.NET]怎样后台执行控制台程序?
- forever让nodejs应用后台执行
- 用nohup命令让Linux下程序永远在后台执行
- C#先执行一段sql等后台操作后再提示是否后续操作confrim
- linux后台执行命令:&和nohup
- 解决Button设置disabled后无法执行后台代码问题
- 将已经执行的程序放到后台 4000 执行