Quantcast
Channel: Question and Answer » cron
Viewing all articles
Browse latest Browse all 165

use find command in bash file

$
0
0

I am using this script in my Linux machine to find all files that were modified yesterday:

#!/bin/bash
find /home/*/domains/*/public_html/  -name "*.php" -mtime -1 | while read line; do
echo "$line"
done

The script works as expected when I run it manually but fails with the error below if I run it from cron:

find: `/home/*/domains/*/public_html/': No such file or directory

distribution: Centos 5

cron:

#DO NOT EDIT THIS FILE. Change through DirectAdmin
MAILTO=MYMAIL@gmail.com
*/1 * * * * bash /home/admin/check_phpfile_changed.sh

single quotes not work


Viewing all articles
Browse latest Browse all 165

Latest Images

Trending Articles



Latest Images