Why my git command has no output in crontab but works well run this script manually?

cat /home/lyang001/update.sh

#!/bin/sh
#shopt -s expand_aliases
HOME_DIR=/home/lyang001/updates
UPDATE_MAIL=${HOME_DIR}/updates.mail
rm $UPDATE_MAIL -rf
cd $HOME_DIR/wr-kernel
git log --no-merges --since="20 day ago" --name-status --pretty=format:"%an %h %s %cd"  origin/WRLINUX_5_0_1_HEAD >> $UPDATE_MAIL
echo "  a               " >> $UPDATE_MAIL
sync
sleep 10

I manually run above scripts it works well and I can get the git' output in update.mail

but I use crontab

40 11 * * * /home/lyang001/update.sh

it can't get the git's output

#!/bin/sh
#shopt -s expand_aliases
HOME_DIR=/home/lyang001/updates
UPDATE_MAIL=${HOME_DIR}/updates.mail
rm $UPDATE_MAIL -rf
cd $HOME_DIR/wr-kernel
git log --no-merges --since="20 day ago" --name-status --pretty=format:"%an %h %s %cd"  origin/WRLINUX_5_0_1_HEAD >> $UPDATE_MAIL
echo "  a               " >> $UPDATE_MAIL
sync
sleep 10

I manually run above scripts it works well and I can get the git' output in update.mail

but I use crontab

40 11 * * * /home/lyang001/update.sh

it can't get the git's output

---------- Post updated at 08:46 PM ---------- Previous update was at 08:42 PM ----------

please delete this one, I just make a mistake

Lei

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.