cf拒绝访问启动失败_在没有访问CF Administrator的情况下安排任务

cf拒绝访问启动失败

…posted by davidjmedlock:

…由 davidjmedlock 发布

Here’s one that was requested when I polled our audience to see what articles our readers would like to see.

这是我对观众进行民意调查以了解读者希望看到的文章时所要求的。

If you are on a Unix-based server, you can usually access your server via telnet and set up cron jobs that will automate processes for you. For example, you may want to create a mail queue that retrieves a list of emails to send from the database or a directory and then send the emails. This is essential if you’re sending out a lot of emails, as in a mailing list or newsletter application.

如果您使用的是基于Unix的服务器,通常可以通过telnet访问您的服务器,并设置cron作业来为您自动执行进程。 例如,您可能想要创建一个邮件队列,该邮件队列从数据库或目录中检索要发送的电子邮件列表,然后发送电子邮件。 如果您要发送大量电子邮件(例如在邮件列表或新闻通讯应用程序中),这是必不可少的。

In this situation you may want the email sent out every night, every 30 minutes, or on some other interval. You don’t want to have to log in to your system and push a button. So, you need a scheduled task to perform this work for you.

在这种情况下,您可能希望每晚,每30分钟或每隔一段时间发送一次电子邮件。 您不需要登录到系统并按一个按钮。 因此,您需要排定的任务才能为您执行这项工作。

The problem with doing this is that most of us run our websites from shared hosts where we don’t have easy access to the ColdFusion Administrator, where we would normally schedule tasks for automatic execution.

这样做的问题在于,我们大多数人都是从共享主机运行我们的网站,在这些主机上我们无法轻松访问ColdFusion管理员,而在正常情况下,我们会在此计划任务以自动执行。

Have no fear! You can do this with a nifty little tag called CFSCHEDULE. It’s very simple to use, as well. Here’s the basic format:

没有恐惧! 您可以使用一个名为CFSCHEDULE的漂亮小标签来执行此操作。 使用起来也非常简单。 基本格式如下:

url="http://www.example.com"

url="http://www.example.com"

This piece of code create the task “MyScheduledTask” if it does not exist and updates it if it does. The task attribute specifies the name of the task, the interval is how often it will run. (You can also specify an endDate and endTime so that it will stop running after a certain date and time.) The operation Attribute specifies that this is an HTTP request to another URL. Then you specify the URL you want to use.

如果不存在,那么这段代码将创建任务“ MyScheduledTask”,如果存在则将其更新。 task属性指定任务的名称,时间间隔是任务运行的频率。 (您也可以指定endDate和endTime,以便它将在特定日期和时间之后停止运行。)操作Attribute指定这是对另一个URL的HTTP请求。 然后,指定要使用的URL。

Sending an HTTP request to example.com will not really do anything. We could, though, choose to save the results of the HTTP request by specifying values for the publish, path and file attributes. (Specify the full path sans the file name for the path attribute and the file name in the file attribute… Obviously.) Make sure that publish is equal to “Yes”. Then after the task runs, the results of the task will be written to that file.

将HTTP请求发送到example.com并不会做任何事情。 但是,我们可以选择通过指定发布,路径和文件属性的值来保存HTTP请求的结果。 (显然,在没有路径属性的文件名和文件属性中的文件名的情况下,指定完整路径。)显然,请确保发布等于“是”。 然后,任务运行后,任务的结果将被写入该文件。

You can also choose to delete and run tasks. If you want to use one of these, specify either “delete” or “run” in the action and the name of the task in the “task” attribute.

您也可以选择删除并运行任务。 如果要使用其中之一,请在操作中指定“删除”或“运行”,并在“任务”属性中指定任务的名称。

There are a few other options for this tag as well, which can be viewed in the LiveDocs. You can basically do anything from this tag that you can do in Administrator. (If you don’t have access to the Administrator, you could use this tag in combination with a database and build your own task administrator.)

该标签还有其他一些选项,可以在LiveDocs中查看。 基本上,您可以使用此标记执行任何在Administrator中可以执行的操作。 (如果您无权访问管理员,则可以将此标签与数据库结合使用,并构建自己的任务管理员。)

Note that some hosts do not allow scheduled tasks and I think that some even disable the CFSCHEDULE tag altogether, so check with your host before trying to use that.

请注意,有些主机不允许排定的任务,我认为有些主机甚至完全禁用了CFSCHEDULE标记,因此在尝试使用主机之前,请与您的主机联系。

翻译自: https://www.sitepoint.com/scheduling-tasks-without-access-to-cf-administrator/

cf拒绝访问启动失败

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值