[GRLUG] crontab not running a working script

John-Thomas Richards jtr at jrichards.org
Thu Jan 12 18:33:52 EST 2012


On Thu, Jan 12, 2012 at 05:48:59PM -0500, Roberto Villarreal wrote:
> On Thursday, January 12, 2012 05:41:22 pm John-Thomas Richards wrote:
> 
> > > Change your script to something like:
> > > #!/bin/bash
> > > strace 'syncevolution memotoo' > /tmp/strace.out 2>&1
> > > 
> > > and run your script manually.  Stash 's.out' away, then let cron call it.
> > > Compare the two output files... they should almost certainly be
> > > different. With luck 'diff' might be able to help, but at some point
> > > those logs should differ in a non-trivial way, and that may hold a clue.
> > > 
> > > (Untested and not 100% if the shell redirection will work properly when
> > > under cron, though I'm thinking it will, and may have to play with
> > > quotes (to ensure it's the output of strace, and not syncevolution,
> > > that's being captures) but using strace was really my point.)
> > 
> > Hmm...
> > 
> > jtr at auerbach ~ $ cat /tmp/strace.out
> > strace: syncevolution memotoo: command not found
> > jtr at auerbach ~
> > 
> > Bleh.
> > --
> > john-thomas
> > ------
> > There are two kinds of fool. One says, "This is old, and therefore
> > good."  And one says, "This is new, and therefore better."
> > John Brunner, science fiction writer (1934-1995)
> 
> Okay, kill the quotes... I just ran a quick test with a command that took an 
> argument, and got a similar error... the quotes are making it look like that 
> whole thing is the command.  Kill the single quotes, and see if you get your 
> file.

Oh, my.  The file resulting from 'diff strace1 strace2 > strace.diff' is 24,700
lines.  Here are the first two lines.

1,2c1,2
< execve("/usr/bin/syncevolution", ["syncevolution", "memotoo"], [/* 6 vars */]) = 0
< brk(0)                                  = 0x227e000
---
> execve("/usr/bin/syncevolution", ["syncevolution", "memotoo"], [/* 32 vars */]) = 0
> brk(0)                                  = 0x1b21000

I have very little idea what any of that means but "6 vars" vs "32 vars" seems,
well, I have no idea.  It seems they should be the same, but then, see my .sig.
What should I look for in this huge file?  Searching for "password" (since
that's the error message) reveals three lines, all from the cron version of the
strace file.
-- 
john-thomas
------
There's no sense in being precise when you don't even know what you're
talking about.
John von Neumann

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the grlug mailing list