我已经看到了一些解决方案,包括监视和在后台运行循环(和休眠)脚本,但没有什么是理想的.
我有一个需要每15秒运行一次的脚本,而且由于cron不会支持秒数,所以我只想搞清楚其他事情.
在unix上每15秒运行一个脚本最强大,最有效的方法是什么?脚本还需要在重新启动后运行.
我有一个使用 Python 的 Scrapy 的爬虫/蜘蛛,我想使用 Amazon Web Services 安排每日爬行。
我想做的是,每天,假设 01:00 UTC。我希望创建一个 ec2 实例并启动 Scrapy 蜘蛛并运行爬行,完成后我希望终止 ec2 实例。
我不希望 ec2 实例继续运行并增加额外的成本/费用,因为将来我将添加更多蜘蛛,这可能会导致每天 20 小时不执行任何操作的十几个被动实例。
我发现了一些关于将 Scrapy 与 ec2 结合使用的帖子:
但所有这些似乎都要求您每次想要安排爬网时都从本地计算机启动该脚本。这似乎不是自动完成的。我希望我的脚本一年 365 天运行,持续 10 年以上,而且我不想每天晚上睡觉前都运行它。
有人可以描述如何使用 Amazon Web Services 完成此操作吗?
我是Linux的新手,我在Raspberry Pi中一直在努力解决这个问题并且没有成功.
首先,我写了一个简单的脚本,/home/myfile.sh如下所示:
#!/bin/bash
clear
echo "hi"
Run Code Online (Sandbox Code Playgroud)
然后我做了sudo chmod 755 /home/myfile.sh授予权限.
最后我修改了crontab使用crontab -e:
# some comments ...
* * * * * /home/myfile.sh
Run Code Online (Sandbox Code Playgroud)
问题:
当我手动运行脚本时它工作正常但是当我在我的上面设置上面的行时crontab,什么都没发生.我究竟做错了什么?
我有两个URL(由于安全问题,我将使用虚拟解释)
a> https://xyz.company.com/ui/api/token
b> https://xyz.company.com/request/transaction?date=2016-01-21&token=<tokeninfo>
Run Code Online (Sandbox Code Playgroud)
当您点击'a'中提到的url时,它将生成一个令牌,让它成为一个包含16个字符的字符串
然后该令牌应该用于在令牌参数中进行点'b'的第二次请求
The second url response is important to me i.e is a JSON response, I need
to filter the json data and extract required data and output it to standard
output and elastic search.
Run Code Online (Sandbox Code Playgroud)
有没有办法在logstash中使用插件"http_poller"或任何其他插件.
注意:这些请求URL应该一个接一个地执行,即点"a"url应该首先执行,并且"b"url应该在接收到新令牌后执行.
请建议.
我有一个 PHP 注册表单,从用户单击提交按钮到它会强制服务器抛出以下错误非常耗时:
Request Timeout
This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.
Run Code Online (Sandbox Code Playgroud)
我一直在谷歌上搜索解决这个问题的方法,似乎有几种方法可以解决这个问题。但是,我想知道这样做的最佳方法是什么。
我将从用户单击提交按钮时开始解释注册表中的步骤:
step 1- it will checks the mysql database for duplicated data.
step 2- it will create 2 mysql tables with their columns
step 3- it will enter the data passed on by the user into the mysql table.
step 4- it …Run Code Online (Sandbox Code Playgroud)