cron problem

Ray Van Dolson rvandolson at esri.com
Fri Apr 6 16:30:48 UTC 2007


> So, now I read oracle's email....
> Right: 
> cron env is /bin/sh; and my backup script has #!/bin/bash as the first line, of course, so that's the shell environment. 
> 
> /bin/sh: -c: line 1: syntax error near unexpected token `&'
> /bin/sh: -c: line 1: `/home/oracle/dbbackup.sh >> /opt/oracle/backup/backup.log 2>>&1'
> 
> So it's a syntax error in the crontab entry... but *why*? 
> Ok, just went into Bourne, and it doesn't like 2>>&1. So, a simple question: won't it toast backup.log if I don't do that as an append - that is, if I do 2>&1, instead of 2>>&1?

I think it should be alright with 2>&1.  You're using >> to append to
the backup.log previous to that and 2>&1 will just made stderr go to
stdout... 

Give it a try and see.

Ray




More information about the redhat-list mailing list