Crontab and testing a command to be executed

前端 未结 2 996
生来不讨喜
生来不讨喜 2021-01-26 06:33

I\'m quite new to cron and crontab.

I\'ve edited the crontab file and I need to execute manually one of commands so I can try it and test it beforehand. How do I do that

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-26 07:31

    To execute a script "manually" you first have to make it executable by doing:

    $ chmod +x yourScriptName
    

    Then do either

    $ ./yourScriptName
    

    if you execute it from its path or

    $ /full/path/to/yourScriptName
    

    from anywhere.

提交回复
热议问题