/etc/cron.daily script is not being executed

Hi All

I have created a file in /etc/cron.daily on redhat linux 7.3 version host
called applicationscript

cat applictaionscript
#!/bin/bash
/prod/data/routine.sh
cat /prod/data/routine.sh
#!/bin/bash
#details
regular=/prod/data/jboss/logs
backup=/prod/data/logs
#echo "Moving logs"
find $regular -name "*.log" -mtime +15 -exec mv -f {} $backup \;
find $backup -name "*.log" -mtime +30 -exec rm -f {} \;

this /prod/data/routine.sh is executing from /prod/data/ but not auto executing from /etc/cron.daily

I checked cat /etc/anacrontab it is all data needed

Please suggest if I am missing something to set up right ?

Please use code tags, not icode tags, use the button.

It's possible that your script is not working because find is not in $PATH, cron gives a very minimal PATH.

For a script this simple running find with an absolute path would do.

1 Like

Hi Corona688

Could you tell once again ? I used full path of the script in /etc/cron.daily/applictaionscript

Corona688 was talking about the find command, not your crontab entry.

1 Like