[GRLUG] crontab not running a working script

Roberto Villarreal rvillarreal at mktec.com
Thu Jan 12 17:15:31 EST 2012


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.

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.)

Roberto

-- 
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