nohup

redis集群维护脚本

十年热恋 提交于 2020-01-11 05:30:47
redis集群维护: 一、启动100\101上的6个节点 主机 192.168.199.101 cd /home/redis-cluster/nodes-7001/ , 执行: nohup /home/redis-4.0.14/src/redis-server ./redis.conf & cd /home/redis-cluster/nodes-7002/ , 执行:nohup /home/redis-4.0.14/src/redis-server ./redis.conf & cd /home/redis-cluster/nodes-7003/ , 执行:nohup /home/redis-4.0.14/src/redis-server ./redis.conf & 主机 192.168.199.100 cd /home/redis-cluster/nodes-7001/ ,执行: nohup /home/redis-4.0.14/src/redis-server ./redis.conf & cd /home/redis-cluster/nodes-7002/ ,执行:nohup /home/redis-4.0.14/src/redis-server ./redis.conf & cd /home/redis-cluster/nodes-7003/ ,执行:nohup

转:nohup命令及其输出文件

北慕城南 提交于 2020-01-11 05:30:42
转:http://www.cnblogs.com/zq-inlook/p/3577003.html nohup命令及其输出文件   今天在linux上部署wdt程序,在SSH客户端执行./start-dishi.sh,启动成功,在关闭SSH客户端后,运行的程序也同时终止了,怎样才能保证在推出SSH客户端后程序能一直执行呢?通过网上查找资料,发现需要使用nohup命令。 完美解决方案:nohup ./start-dishi.sh >output 2>&1 & 现对上面的命令进行下解释 用途:不挂断地运行命令。 语法:nohup Command [ Arg ... ] [ & ] 描述:nohup 命令运行由 Command 参数和任何相关的 Arg 参数指定的命令,忽略所有挂断(SIGHUP)信号。在注销后使用 nohup 命令运行后台中的程序。要运行后台中的 nohup 命令,添加 & ( 表示“and”的符号)到命令的尾部。 操作系统中有三个常用的流:   0:标准输入流 stdin   1:标准输出流 stdout   2:标准错误流 stderr   一般当我们用 > console.txt,实际是 1>console.txt的省略用法;< console.txt ,实际是 0 < console.txt的省略用法。 下面步入正题: >nohup ./start-dishi

linux后台运行脚本

梦想与她 提交于 2020-01-09 23:22:03
前几天接到一个任务,要运行一个脚本,批量操作数据。 首先想到的是定时任务:crontab -e 编辑定时脚本。 后来尝试后台运行。现在整理一下: nohup php test.php > out.log 2>&1 & nohup和&的区别 **&:**指在后台运行。当在前台运行某个作业时,终端被该作业占据;可以在命令后面加上& 实现后台运行。使用&命令时,关闭当前控制台窗口或退出当前帐户时,作业就会停止运行。 **nohup:**即no hang up[不挂起]。不挂断的运行,注意并没有后台运行的功能,,就是指,用nohup运行命令可以使命令永久的执行下去,和用户终端没有关系,例如我们断开SSH连接都不会影响他的运行,注意了nohup没有后台运行的意思;&才是后台运行。 参数解析 nohup php test.php > out.log 2>&1 & 在上面的例子中,0 – stdin (standard input),1 – stdout (standard output),2 – stderr (standard error) ; 2>&1是将标准错误(2)重定向到标准输出(&1),标准输出(&1)再被重定向输入到out.log 文件中。 '>>‘和’>'都属于输出重定向,<属于输入重定向。 '>'会覆盖目标的原有内容。当文件存在时会先删除原文件,再重新创建文件

redis

你离开我真会死。 提交于 2020-01-07 20:14:10
目录 1.redis简介 2.redis定义 3.redis安装 1.redis简介 Redis(全称:Remote Dictionary Server 远程字典服务)是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。从2010年3月15日起,Redis的开发工作由VMware主持。从2013年5月开始,Redis的开发由Pivotal赞助。 2.redis定义 redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sorted set --有序集合)和hash(哈希类型)。这些数据类型都支持push/pop、add/remove及取交集并集和差集及更丰富的操作,而且这些操作都是原子性的。在此基础上,redis支持各种不同方式的排序。与memcached一样,为了保证效率,数据都是缓存在内存中。区别的是redis会周期性的把更新的数据写入磁盘或者把修改操作写入追加的记录文件,并且在此基础上实现了master-slave(主从)同步。 Redis 是一个高性能的key-value数据库。 redis的出现,很大程度补偿了memcached这类key/value存储的不足,在部

Send Output errors of nohup to syslog

柔情痞子 提交于 2020-01-02 08:10:17
问题 I'm attempting to write a bash script that uses nohup and passes errors to rsyslog. I've tried this command with different variations of the log variable (see below) but can't get the output passed to anything but a std txt file. I can't get it to pipe. nohup imageprocessor.sh > "$LOG" & Is it possible to pipe nohup output or do I need a different command. A couple of variations of log that I have tried LOG="|/usr/bin/logger -t workspaceworker -p LOCAL5.info &2" or LOG="|logtosyslog.sh" or

How do I keep a Perl script running on Unix after I log off?

南笙酒味 提交于 2020-01-01 19:26:06
问题 I have a script that takes a lot of time to complete. Instead of waiting for it to finish, I'd rather just log out and retrieve its output later on. I've tried; at -m -t 03030205 -f /path/to/./thescript.pl nohup /path/to/./thescript.pl & And I have also verified that the processes actually exist with ps and at -l depending on which scheduling syntax i used. Both these processes die when I exit out of the shell. Is there a way to keep a script from terminating when I close the connection? We

nohup .和&

泪湿孤枕 提交于 2020-01-01 18:02:44
看到大佬使用nohup eclipse & 来启动后台进程相当羡慕,因为我们这种菜鸡一般使用eclipse &来启动,大佬居然知道这么多命令。 下去查了一下发现nohup的意思是忽略SIGHUP信号,好像和启动后台没有半毛钱关系嘛。 继续查询,SIGHUP 信号在 用户终端连接(正常或非正常)结束 时发出, 也就是在只关闭shell的情况下,后台进程不会退出,继续运行。 学到了。 来源: CSDN 作者: 爱睡懒觉的平头哥 链接: https://blog.csdn.net/u014545085/article/details/103793847

颂游搭建教程

你。 提交于 2019-12-29 15:09:12
1,伪静态规则: location /qp_host/ { if (!-e $request_filename){ rewrite ^/qp_host/(.*)$ /qp_host/index.php?s=$1 last; } } location /qp_ht/ { if (!-e $request_filename){ rewrite ^/qp_ht/(.*)$ /qp_ht/index.php?s=$1 last; } } location /qp_down/ { if (!-e $request_filename){ rewrite ^/qp_down/(.*)$ /qp_down/index.php?s=$1 last; } } 2,网站更改,和数据库端口3308(根据自己数据库端口去改) Desktop\default\qp_host\Mobile\Admin\Common\function.php Desktop\default\qp_host\Mobile\Admin\Conf\config.php Desktop\default\qp_host\Mobile\Pay\Conf\config.php Desktop\default\qp_ht\application\database.php Desktop\default\qp_ht\application

Nohup and Python -u : it still doesn't log data in realtime

喜你入骨 提交于 2019-12-29 07:49:47
问题 When launching a Python process, in background, with nohup python myscript.py > test.log 2>&1 < /dev/null & the problem is that stdout is buffered: the data is not written in realtime to test.log . The common solution to this problem is to flush periodically with sys.stdout.flush() , or even better, as suggested by this answer, to use python -u : nohup python -u myscript.py > test.log 2>&1 < /dev/null & But this is not enough . I noticed that it worked during a few hours, and then, it stopped

Starting background tasks with Capistrano

ε祈祈猫儿з 提交于 2019-12-29 04:13:26
问题 For my RubyOnRails-App I have to start a background job at the end of Capistrano deployment. For this, I tried the following in deploy.rb: run "nohup #{current_path}/script/runner -e production 'Scheduler.start' &", :pty => true Sometimes this works, but most of the time it does not start the process (= not listed in ps -aux). And there are no error messages. And there is no nohup.out, not in the home directory and not in the rails app directory. I tried using trap('SIGHUP', 'IGNORE') in