如何检查服务器中是否存在文件? [英] How to check if a file exists in server?

查看:214
本文介绍了如何检查服务器中是否存在文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我有一个magento网站。有时,导入未完成,因此在这些情况下产品价格,图像等不会更新。手动我必须每天检查,登录到服务器,并转到导入文件所在的目录,如果我没有找到这些文件,而不是再次开始导出。我的想法是创建一个自动化流程。就像代理人一样,检查导入的文件是否来了,而不是通过邮件通知我。

您会建议什么?

Hello
I have a magento site. sometimes, import isnt completed, so in these cases products prices,images ect are not updated. Manually i have to check everyday, login into server, and go to the directory where import files are located, and if i dont find those files than start exporting again. My idea consists, on creating an automated process. Like an agent, who checks if imported files came and if not, than notify me, with a mail.
What would you suggest?

推荐答案

如果我理解正确,您希望自动执行仍然手动的任务而不会弄乱系统。

这是你的情况,检查特定路径中文件的存在。



这应该很容易。

只需创建一个检查路径的脚本,并在有更改时邮寄给你。

然后设置一个cron来执行该脚本。



你说你有一个日常的cron工作。

我建议设置新脚本以便在那之后运行。



这取决于您的服务器上可用于创建脚本的内容。
If I understand correctly, you want to automate a task that is still manual without messing with the system.
Which is in your case, checking the existence of files in a certain path.

That should be pretty easy.
Just create a script that checks the path and mails you if there are changes.
Then setup a cron to execute that script.

You said that you have a daily cron job.
I suggest setting up the new script to run after that.

It depends on what's available on your server to create the script.


https://msdn.microsoft.com/en-us/library/system.io.file.exists(v = vs.110)的.aspx [ ^ ]


这篇关于如何检查服务器中是否存在文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆