通过 SFTP 传输的文件
我有一个 Linux (openSUSE 10.X) 机器,上面有 SFTP 服务。
当有人放置文件时,我必须编写一个脚本将文件移动到另一个目录。我不想写一个 cron 作业。是否有事件或其他内容我可以检查他们是否已发送文件?
I have a Linux (openSUSE 10.X) box and have a SFTP service on it.
When someone puts a file I have to write a script to move the files to another dir. I do not want to write a cron job. Is there an event or something I can check to see if they have sent the file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以编写 ac 应用程序并挂钩 inotify 事件。
You can write a c application and hook into inotify events.
另请检查 SFTP 服务器 Net::SFTP::Server用 Perl 编写,可以扩展来完成您需要的事情。
一些代码:
将脚本保存到服务器中的某个位置,
chmod 755 $it
,并将 OpenSSH 配置为将其用作 SFTP 服务器而不是默认服务器。Check also Net::SFTP::Server, an SFTP server written in Perl that can be extended to do things like the one you need.
Some code:
Save the script to somewhere in your server,
chmod 755 $it
, and configure OpenSSH to use it as the SFTP server instead of the default one.