drtkyykai004574380 2012-01-17 08:53
浏览 13

为绝对路径设置cron作业

I am using MVC framework. Now I want to set up cron such that the URL "http://www.xyz.com/controllera/functiona" should be executed. what should i write in the path section for it.

I got something about "GET" command but it wasnt clear.

Can someone please help me out with it?

  • 写回答

2条回答 默认 最新

  • dow72046 2012-01-17 09:00
    关注

    I don't understand the "module called cron" part of your question. I believe you are confused, cron is a service on Linux and other Unix systems configured thru crontab.

    A crontab(5) entry is defined by a time and date and a command to run.

    On Linux and Posix systems, you cannot execute or run an URL. Running something involves the execve(2) system call, which requires an executable file path (and arguments).

    Perhaps you want to retrieve some URL using the HTTP protocol. You might use a command-line HTTP client, like wget or curl.

    So perhaps the command you want to run in your crontab might be

     wget http://www.xyz.com/controllera/functiona
    

    but you could use curl

    My guess is that you are confused, and don't understand well enough your question. Consider reading some material.

    For example, to retrieve that URL once a day at 3 pm, you would have the following crontab entry:

       # run everyday at 3 pm a GET HTTP request
       0 15 * * *  /usr/bin/wget http://www.xyz.com/controllera/functiona
    

    Use the crontab(1) command to configure your crontab (which may contain several entries, and several variable definitions, so you may have to edit it).

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用