使用 Pentaho 从远程 SFTP 删除超过 7 天的文件 [英] Delete files older than 7 days from a remote SFTP with Pentaho

查看:81
本文介绍了使用 Pentaho 从远程 SFTP 删除超过 7 天的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Pentado 数据集成 8.2.我对 Pentaho 的经验很少.

I'm using Pentado Data Integration 8.2. I've little experience with Pentaho.

我需要使用 Pentaho 创建一个作业,从远程 SFTP 中删除超过 7 天的文件.

I need create a job with Pentaho that deletes files older than 7 days from a remote SFTP.

我进行了搜索,但找不到远程 SFTP 的解决方案.

I searched, but I couldn't find a solution with remote SFTP.

谢谢.

推荐答案

您可以使用 Run ssh 组件连接到您的主目录.在 commands 选项卡下的 settings 选项卡中,运行以下命令.

You can use the Run ssh component to connect to your home directory. In the settings tab under the commands tab, run the following command.

find /path/to/ \
  -type f \
  -mtime +7 \
  -name '*.txt' \
  -execdir rm -- '{}' \;

这将删除所有超过 7 天的 txt 文件.

This will delete all the txt files older than 7 days.

这篇关于使用 Pentaho 从远程 SFTP 删除超过 7 天的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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