RE: pretty format can't work on cron job

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Jeff King [mailto:peff@xxxxxxxx]
> Sent: 2010å11æ5æ 21:15
> To: chen_wang@xxxxxxxxxxxxxxxxx
> Cc: j.sixt@xxxxxxxxxxxxx; git@xxxxxxxxxxxxxxx; ellre923@xxxxxxxxx
> Subject: Re: pretty format can't work on cron job
> 
> On Fri, Nov 05, 2010 at 04:47:05PM +0800, chen_wang@xxxxxxxxxxxxxxxxx
> wrote:
> 
> > > > But when I put that command on cron job, even I run â. /etc/profileâ and
> â.
> > > ~/.bash_profileâ first, I canât get correct format of output.
> > > > -------------------------------------------------
> > > > Author: %aN <amit.shah@xxxxxxxxxx>; Date: Wed Oct 20 13:45:43 2010
> > > +1030
> > > >  100.0% drivers/char/
> > > >  1 files changed, 14 insertions(+), 3 deletions(-)
> > > > -------------------------------------------------
> > >
> > > % has a special meaning in a crontab. See man 5 crontab.
> > >
> >
> > I warped this command in script and trigger script in crontab.
> > I think it's not the root cause, because %ae still works.
> 
> I notice that the only placeholder that is broken is %aN, which converts
> using the .mailmap file. Maybe something in your environment is
> preventing reading that file properly?
> 

$ ll .mailmap
-rw-r--r-- 1 wangchen club 4021 Oct 15 06:18 .mailmap

> Can you show us the exact script you're calling from your crontab file?
> I'm wondering if it's something to do with being in the same directory.
> 

Sure.
$ crontab -l
58 06 * * * /home/wangchen/kps_update
$ cat /home/wangchen/kps_update
#!/bin/bash
su wangchen -
. /etc/profile
. ~/.bash_profile
cd /home/wangchen/kps
git pull
make
cd /home/wangchen/linux-2.6
git pull
/home/wangchen/kps/kps_web/kps_do /home/wangchen/linux-2.6 /home/wangchen/kps
$ cat /home/wangchen/kps/kps_web/kps_do
#!/bin/sh
#check script parameters
if [ -r $1 -a -w $2 ]; then
        echo "begin to update kps_result"
        readonly LGP=$1
        KGP=$2
        KGP=${KGP%%/}
else
        echo "usage: $0 linux_kernel_source_dir kps_source_dir"
        exit 1
fi
cd $LGP
git log 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.. -M --date=short --pretty=format:"Author: %aN <%ae>; Date: %ad" --shortstat --dirstat --no-merges >/tmp/ChangeLog-all

> -Peff

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]