[NTLUG:Discuss] Cron Job Issues

Wayne Walker wwalker at bybent.com
Wed Aug 2 13:06:27 CDT 2006


man 5 crontab 

yields

"...Percent-signs (%) in the command, unless  escaped with backslash
(\), will be changed into newline characters..."

so, backslashes in front of the % signs will fix you up.

Wayne

On Wed, Aug 02, 2006 at 06:55:53AM -0500, Stephen Davidson wrote:
> Greetings.
> 
> I am hoping that this is something reasonably routine, designed just to 
> trip up newbies.  I am trying to copy a tar ball generated by a backup 
> job from one server to another.  I only need the latest file in the 
> directory, not all of the files in the directory.
> 
> So, I worked out the following command line;
> scp -p steve at j2eeguys.com:/work/backups/CVS.`date +%Y%m%d`.tgz 
> /work/sda1/backups
> 
> That works from the command line.  However, when I put this in a 
> crontab, it fails????  I get mailed the following output,
> 
>  From steve at blue.j2eeguys.com  Wed Aug  2 01:30:03 2006
> Date: Wed, 2 Aug 2006 01:30:01 -0500
> From: root at blue.j2eeguys.com (Cron Daemon)
> To: steve at blue.j2eeguys.com
> Subject: Cron <steve at blue> scp -p 
> steve at j2eeguys.com:/work/backups/HRXCVS.`date +
> X-Cron-Env: <SHELL=/bin/sh>
> X-Cron-Env: <HOME=/home/steve>
> X-Cron-Env: <PATH=/usr/bin:/bin>
> X-Cron-Env: <LOGNAME=steve>
> X-Cron-Env: <USER=steve>
> 
> /bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
> /bin/sh: -c: line 1: syntax error: unexpected end of file
> 
> So, any suggestions on how to fix this????  I was hoping I could just 
> drop a 'one-liner' into my crontab to do the copy.
> 
> -Steve
> 
> 
> _______________________________________________
> http://ntlug.pmichaud.com/mailman/listinfo/discuss

-- 

Wayne Walker

www.unwiredbuyer.com - when you just can't be by the computer

wwalker at bybent.com                    Do you use Linux?!
http://www.bybent.com                 Get Counted!  http://counter.li.org/
Perl - http://www.perl.org/           Perl User Groups - http://www.pm.org/
Jabber:  wwalker at jabber.gnumber.com   AIM:     lwwalkerbybent
IRC:     wwalker on freenode.net



More information about the Discuss mailing list