[GRLUG] crontab not running a working script
John-Thomas Richards
jtr at jrichards.org
Thu Jan 12 17:41:22 EST 2012
On Thu, Jan 12, 2012 at 05:15:31PM -0500, Roberto Villarreal wrote:
> On Thursday, January 12, 2012 11:47:07 am John-Thomas Richards wrote:
> > I sync my box to memotoo.com's service. Works from the commandline with
> > `syncevolution memotoo'. The password is in the config files so when I
> > enter the above command, it syncs, then I'm back to a command prompt. I
> > can take that command and put it in a simple bash script:
> >
> > #!/bin/bash
> > syncevolution memotoo
> >
> >
> > It works as expected; no further input is needed. However, when I put
> > that script into my crontab, I get this error message:
> >
> > Enter password for memotoo: [ERROR] error code from
> > SyncEvolution fatal error (local, status 10500): could not read
> > password for memotoo
> >
> > Synchronization failed, see
> >
> > /home/jtr/.cache/syncevolution/memotoo-2012-01-12-11-38/syncevolution-log.
> > html for details.
> >
> > The error log simply repeats that it could not read the password.
> >
> > My scripting skills are limited; am I missing something? If it works
> > from a commandline should it not also work from cron?
>
> As a worst case (and is worst case as your eyes and brain may start bleeding),
> you could use strace; it could likely give you a clue, if not the answer.
At the very least I like the challenge.
> 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)
--
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