pm2 -h

Usage: pm2 [cmd] app

Options:

-V, --version                                                output the version number
-v --version                                                 print pm2 version
-s --silent                                                  hide all messages
--ext <extensions>                                           watch only this file extensions
-n --name <name>                                             set a name for the process in the process list
-m --mini-list                                               display a compacted list without formatting
--interpreter <interpreter>                                  set a specific interpreter to use for executing app, default: node
--interpreter-args <arguments>                               set arguments to pass to the interpreter (alias of --node-args)
--node-args <node_args>                                      space delimited arguments to pass to node
-o --output <path>                                           specify log file for stdout
-e --error <path>                                            specify log file for stderr
-l --log [path]                                              specify log file which gathers both stdout and stderr
--filter-env [envs]                                          filter out outgoing global values that contain provided strings (default: )
--log-type <type>                                            specify log output style (raw by default, json optional)
--log-date-format <date format>                              add custom prefix timestamp to logs
--time                                                       enable time logging
--disable-logs                                               disable all logs storage
--env <environment_name>                                     specify which set of environment variables from ecosystem file must be injected
-a --update-env                                              force an update of the environment with restart/reload (-a <=> apply)
-f --force                                                   force actions
-i --instances <number>                                      launch [number] instances (for networked app)(load balanced)
--parallel <number>                                          number of parallel actions (for restart/reload)
--shutdown-with-message                                      shutdown an application with process.send('shutdown') instead of process.kill(pid, SIGINT)
-p --pid <pid>                                               specify pid file
-k --kill-timeout <delay>                                    delay before sending final SIGKILL signal to process
--listen-timeout <delay>                                     listen timeout on application reload
--max-memory-restart <memory>                                Restart the app if an amount of memory is exceeded (in bytes)
--restart-delay <delay>                                      specify a delay between restarts (in milliseconds)
--exp-backoff-restart-delay <delay>                          specify a delay between restarts (in milliseconds)
-x --execute-command                                         execute a program using fork system
--max-restarts [count]                                       only restart the script COUNT times
-u --user <username>                                         define user when generating startup script
--uid <uid>                                                  run target script with <uid> rights
--gid <gid>                                                  run target script with <gid> rights
--namespace <ns>                                             start application within specified namespace
--cwd <path>                                                 run target script from path <cwd>
--hp <home path>                                             define home path when generating startup script
--wait-ip                                                    override systemd script to wait for full internet connectivity to launch pm2
--service-name <name>                                        define service name when generating startup script
-c --cron <cron_pattern>                                     restart a running process based on a cron pattern
-c --cron-restart <cron_pattern>                             (alias) restart a running process based on a cron pattern
-w --write                                                   write configuration in local folder
--no-daemon                                                  run pm2 daemon in the foreground if it doesn't exist already
--source-map-support                                         force source map support
--only <application-name>                                    with json declaration, allow to only act on one application
--disable-source-map-support                                 force source map support
--wait-ready                                                 ask pm2 to wait for ready event from your app
--merge-logs                                                 merge logs from different instances but keep error and out separated
--watch [paths]                                              watch application folder for changes (default: )
--ignore-watch <folders|files>                               List of paths to ignore (name or regex)
--watch-delay <delay>                                        specify a restart delay after changing files (--watch-delay 4 (in sec) or 4000ms)
--no-color                                                   skip colors
--no-vizion                                                  start an app without vizion feature (versioning control)
--no-autorestart                                             start an app without automatic restart
--no-treekill                                                Only kill the main process, not detached children
--no-pmx                                                     start an app without pmx
--no-automation                                              start an app without pmx
--trace                                                      enable transaction tracing with km
--disable-trace                                              disable transaction tracing with km
--sort <field_name:sort>                                     sort process according to field's name
--attach                                                     attach logging after your start/restart/stop/reload
--v8                                                         enable v8 data collecting
--event-loop-inspector                                       enable event-loop-inspector dump in pmx
--deep-monitoring                                            enable all monitoring tools (equivalent to --v8 --event-loop-inspector --trace)
-h, --help                                                   output usage information

Commands:

start [options] [name|namespace|file|ecosystem|id...]        start and daemonize an app
trigger <id|proc_name|namespace|all> <action_name> [params]  trigger process action
deploy <file|environment>                                    deploy your json
startOrRestart <json>                                        start or restart JSON file
startOrReload <json>                                         start or gracefully reload JSON file
pid [app_name]                                               return pid of [app_name] or all
create                                                       return pid of [app_name] or all
startOrGracefulReload <json>                                 start or gracefully reload JSON file
stop [options] <id|name|namespace|all|json|stdin...>         stop a process
restart [options] <id|name|namespace|all|json|stdin...>      restart a process
scale <app_name> <number>                                    scale up/down a process in cluster mode depending on total_number param
profile:mem [time]                                           Sample PM2 heap memory
profile:cpu [time]                                           Profile PM2 cpu
reload <id|name|namespace|all>                               reload processes (note that its for app using HTTP/HTTPS)
id <name>                                                    get process id by name
inspect <name>                                               inspect a process
delete|del <name|id|namespace|script|all|json|stdin...>      stop and delete a process from pm2 process list
sendSignal <signal> <pm2_id|name>                            send a system signal to the target process
ping                                                         ping pm2 daemon - if not up it will launch it
updatePM2                                                    update in-memory PM2 with local PM2
update                                                       (alias) update in-memory PM2 with local PM2
install|module:install [options] <module|git:/>              install or update a module and run it forever
module:update <module|git:/>                                 update a module and run it forever
module:generate [app_name]                                   Generate a sample module in current folder
uninstall|module:uninstall <module>                          stop and uninstall a module
package [target]                                             Check & Package TAR type module
publish|module:publish [options] [folder]                    Publish the module you are currently on
set [key] [value]                                            sets the specified config <key> <value>
multiset <value>                                             multiset eg "key1 val1 key2 val2
get [key]                                                    get value for <key>
conf [key] [value]                                           get / set module config values
config <key> [value]                                         get / set module config values
unset <key>                                                  clears the specified config <key>
report                                                       give a full pm2 report for https://github.com/Unitech/pm2/issues
link [options] [secret] [public] [name]                      link with the pm2 monitoring dashboard
unlink                                                       unlink with the pm2 monitoring dashboard
monitor [name]                                               monitor target process
unmonitor [name]                                             unmonitor target process
open                                                         open the pm2 monitoring dashboard
plus|register [options] [command] [option]                   enable pm2 plus
login                                                        Login to pm2 plus
logout                                                       Logout from pm2 plus
dump|save [options]                                          dump all processes for resurrecting them later
cleardump                                                    Create empty dump file
send <pm_id> <line>                                          send stdin to <pm_id>
attach <pm_id> [comman]                                      attach stdin/stdout to application identified by <pm_id>
resurrect                                                    resurrect previously dumped processes
unstartup [platform]                                         disable the pm2 startup hook
startup [platform]                                           enable the pm2 startup hook
logrotate                                                    copy default logrotate configuration
ecosystem|init [mode]                                        generate a process conf file. (mode = null or simple)
reset <name|id|all>                                          reset counters for process
describe <name|id>                                           describe all parameters of a process
desc <name|id>                                               (alias) describe all parameters of a process
info <name|id>                                               (alias) describe all parameters of a process
show <name|id>                                               (alias) describe all parameters of a process
env <id>                                                     list all environment variables of a process id
list|ls                                                      list all processes
l                                                            (alias) list all processes
ps                                                           (alias) list all processes
status                                                       (alias) list all processes
jlist                                                        list all processes in JSON format
sysmonit                                                     start system monitoring daemon
slist|sysinfos [options]                                     list system infos in JSON
prettylist                                                   print json in a prettified JSON
monit                                                        launch termcaps monitoring
imonit                                                       launch legacy termcaps monitoring
dashboard|dash                                               launch dashboard with monitoring and logs
flush [api]                                                  flush logs
reloadLogs                                                   reload all logs
logs [options] [id|name|namespace]                           stream logs file. Default stream all logs
kill                                                         kill daemon
pull <name> [commit_id]                                      updates repository for a given app
forward <name>                                               updates repository to the next commit for a given app
backward <name>                                              downgrades repository to the previous commit for a given app
deepUpdate                                                   performs a deep update of PM2
serve|expose [options] [path] [port]                         serve a directory over http via port
autoinstall
examples                                                     display pm2 usage examples
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市或南,隨后出現(xiàn)的幾起案子穆端,更是在濱河造成了極大的恐慌,老刑警劉巖琼懊,帶你破解...
    沈念sama閱讀 211,743評(píng)論 6 492
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件抡笼,死亡現(xiàn)場(chǎng)離奇詭異锚贱,居然都是意外死亡欢策,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,296評(píng)論 3 385
  • 文/潘曉璐 我一進(jìn)店門赏淌,熙熙樓的掌柜王于貴愁眉苦臉地迎上來踩寇,“玉大人,你說我怎么就攤上這事六水“乘铮” “怎么了?”我有些...
    開封第一講書人閱讀 157,285評(píng)論 0 348
  • 文/不壞的土叔 我叫張陵掷贾,是天一觀的道長捞奕。 經(jīng)常有香客問我狼电,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 56,485評(píng)論 1 283
  • 正文 為了忘掉前任渐溶,我火速辦了婚禮,結(jié)果婚禮上欲鹏,老公的妹妹穿的比我還像新娘抄瑟。我一直安慰自己,他們只是感情好浅缸,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,581評(píng)論 6 386
  • 文/花漫 我一把揭開白布轨帜。 她就那樣靜靜地躺著,像睡著了一般衩椒。 火紅的嫁衣襯著肌膚如雪蚌父。 梳的紋絲不亂的頭發(fā)上哮兰,一...
    開封第一講書人閱讀 49,821評(píng)論 1 290
  • 那天,我揣著相機(jī)與錄音苟弛,去河邊找鬼喝滞。 笑死,一個(gè)胖子當(dāng)著我的面吹牛嗡午,可吹牛的內(nèi)容都是我干的囤躁。 我是一名探鬼主播,決...
    沈念sama閱讀 38,960評(píng)論 3 408
  • 文/蒼蘭香墨 我猛地睜開眼荔睹,長吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼狸演!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起僻他,我...
    開封第一講書人閱讀 37,719評(píng)論 0 266
  • 序言:老撾萬榮一對(duì)情侶失蹤宵距,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后吨拗,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體满哪,經(jīng)...
    沈念sama閱讀 44,186評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,516評(píng)論 2 327
  • 正文 我和宋清朗相戀三年劝篷,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了哨鸭。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 38,650評(píng)論 1 340
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡娇妓,死狀恐怖像鸡,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情哈恰,我是刑警寧澤只估,帶...
    沈念sama閱讀 34,329評(píng)論 4 330
  • 正文 年R本政府宣布,位于F島的核電站着绷,受9級(jí)特大地震影響蛔钙,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜荠医,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,936評(píng)論 3 313
  • 文/蒙蒙 一吁脱、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧彬向,春花似錦豫喧、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,757評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至缕棵,卻和暖如春孵班,著一層夾襖步出監(jiān)牢的瞬間涉兽,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,991評(píng)論 1 266
  • 我被黑心中介騙來泰國打工篙程, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留枷畏,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 46,370評(píng)論 2 360
  • 正文 我出身青樓虱饿,卻偏偏與公主長得像拥诡,于是被迫代替她去往敵國和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子氮发,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,527評(píng)論 2 349