zoukankan      html  css  js  c++  java
  • tmux会话断电保存自动恢复

    tmux可以用于会话管理,通过建立session,可以保证当前设备和服务期断开连接之后,会话中的指令继续运行,非常适合用于执行需要长时间运行的任务。
    但是tmux也有一个问题,那就是session在服务器上不会保存,重启断电之后需要重新创建session。
    这里我们通过两个tmux插件来实现session断电保存和自动恢复:

    • Tmux Resurrect 会话手动保存恢复
    • Tmux Continuum 绘画定时保存恢复

    下载插件:

    mkdir -p ~/.tmux
    cd ~/.tmux
    git clone https://github.com/tmux-plugins/tmux-resurrect.git
    git clone https://github.com/tmux-plugins/tmux-continuum.git
    

    如果 github网速不好,可以考虑使用gitee镜像:

    git clone https://gitee.com/extra-mirrors/tmux-resurrect.git
    git clone https://gitee.com/extra-mirrors/tmux-continuum.git
    

    配置启用插件,编辑 ~/.tmux.conf

    run-shell ~/.tmux/tmux-resurrect/resurrect.tmux
    run-shell ~/.tmux/tmux-resurrect/continuum.tmux
    

    然后重新加载配置文件生效:

    tmux source-file ~/.tmux.conf
    

    参考

    1. tmux使用手册| Louis blog
  • 相关阅读:
    jquery-validate v1.19.2 源码分析
    jquery之遍历-Section04
    jquery之元素-Section03
    jquery之效果-Section02
    jquery之入门-Section01
    CSS世界(七)思维导图
    shell文件处理awk
    jquery插件懒加载
    jquery插件改变背景色
    jquery多库共存
  • 原文地址:https://www.cnblogs.com/zhcpku/p/15544442.html
Copyright © 2011-2022 走看看