Why I've got no crontab entry on OS X when using vim?

前端 未结 12 1754
执念已碎
执念已碎 2020-12-07 07:41

I would like to use cron on my Mac. I choose it over launchd, because I want to be able to use my new knowledge on Linux as well. However, I cannot seem to get

12条回答
  •  一生所求
    2020-12-07 07:56

    Just follow these steps:

    1. In Terminal: crontab -e.
    2. Press i to go into vim's insert mode.
    3. Type your cron job, for example:

      30 * * * * /usr/bin/curl --silent --compressed http://example.com/crawlink.php
      
    4. Press Esc to exit vim's insert mode.

    5. Type ZZ to exit vim (must be capital letters).
    6. You should see the following message: crontab: installing new crontab. You can verify the crontab file by using crontab -l.

    Note however that this might not work depending on the content of your ~/.vimrc file.

提交回复
热议问题