zoukankan      html  css  js  c++  java
  • mac下普通用户无法创建crontab的问题解决

    想在mac下弄一个crontab定时任务,以为会像linux上那样顺利那,结果碰壁了,报错信息例如以下:

    ➜  autoshell  crontab -e
    crontab: no crontab for laijingli - using an empty one
    crontab: temp file must be edited in place


    就是这个 must be edited in place提示也太模糊了了吧,网上有说是编辑器环境变量的问题。加上也不行呀


    ➜  autoshell  EDITOR=vim crontab -e
    crontab: no crontab for laijingli - using an empty one
    crontab: temp file must be edited in place


    ➜  autoshell  EDITOR=vi crontab -e
    crontab: no crontab for laijingli - using an empty one
    crontab: temp file must be edited in place


    參考了一外国哥们的方法,vim设置对文件类型为crontab的文件不进行backup、writebackup,虽不非常明确,但起作用了,期待高手指点迷津。

    ➜  ~  vim ~/.vimrc 加入例如以下2行

     21 "解决crontab -e时,提示crontab: temp file must be edited in place
     22 autocmd filetype crontab setlocal nobackup nowritebackup


    ➜  ~  crontab -l
    1 * * * *  /Users/laijingli/autoshell/fastproxy >>/tmp/fastproxy.log


    Reference:http://calebthompson.io/crontab-and-vim-sitting-in-a-tree/

  • 相关阅读:
    Cardiogram
    Increasing Speed Limits HDU
    Beaver Game CodeForces
    C++LeetCode:: Container With Most Water
    C++ leetcode::Reverse Integer
    C++ leetcode::ZigZag Conversion
    C++ leetcode Longest Palindromic Substring
    C++ leetcode Longest Substring Without Repeating Characters
    Faster RCNN
    C++ Leetcode Median of Two Sorted Arrays
  • 原文地址:https://www.cnblogs.com/tlnshuju/p/7323858.html
Copyright © 2011-2022 走看看