简体   繁体   中英

linux Find command not working through crontab

I am using the command given below to delete the 2 days old data from the folder. The command works fine when I run this through directly terminal but not working through crontab entry.

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

Crontab Entry:

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 .

Try adding that in your crontab script

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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