简体   繁体   English

linux 查找命令无法通过 crontab

[英]linux Find command not working through crontab

I am using the command given below to delete the 2 days old data from the folder.我正在使用下面给出的命令从文件夹中删除 2 天前的数据。 The command works fine when I run this through directly terminal but not working through crontab entry.当我通过直接终端运行此命令但不通过 crontab 条目运行时,该命令工作正常。

find /backup/DWHPROD/ -type f -mtime +1 -exec rm -r {} \;

Crontab Entry: crontab 条目:

30 16 * * * find /backup/DWHPROD/ -type f -mtime +1 -exec rm -r {} \;

Please run the command in your terminal:请在终端中运行命令:

which find

I am having find located at /usr/bin/find .我的 find 位于/usr/bin/find

Try adding that in your crontab script尝试在您的 crontab 脚本中添加它

30 16 * * * /usr/bin/find /backup/DWHPROD/ -type f -mtime +1 -exec rm -r {} \;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM