<br><br><div class="gmail_quote">On Thu, Jan 12, 2012 at 2:45 PM, John-Thomas Richards <span dir="ltr"><<a href="mailto:jtr@jrichards.org" target="_blank">jtr@jrichards.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>On Thu, Jan 12, 2012 at 12:28:55PM -0500, Michael Mol wrote:<br>
> Bob Kline wrote:<br>
> ><br>
> ><br>
> > On Thu, Jan 12, 2012 at 12:13 PM, John-Thomas Richards<br>
> > <<a href="mailto:jtr@jrichards.org" target="_blank">jtr@jrichards.org</a> <mailto:<a href="mailto:jtr@jrichards.org" target="_blank">jtr@jrichards.org</a>>> wrote:<br>
> ><br>
> >     On Thu, Jan 12, 2012 at 12:04:17PM -0500, Ben Rousch wrote:<br>
> >     > On Thu, Jan 12, 2012 at 11:47 AM, John-Thomas Richards<br>
> >     > <<a href="mailto:jtr@jrichards.org" target="_blank">jtr@jrichards.org</a> <mailto:<a href="mailto:jtr@jrichards.org" target="_blank">jtr@jrichards.org</a>>> wrote:<br>
> >     > > I sync my box to <a href="http://memotoo.com" target="_blank">memotoo.com</a> <<a href="http://memotoo.com" target="_blank">http://memotoo.com</a>>'s service.<br>
> >      Works from the commandline with<br>
> >     > > `syncevolution memotoo'.  The password is in the config files so<br>
> >     when I<br>
> >     > > enter the above command, it syncs, then I'm back to a command<br>
> >     prompt.  I<br>
> >     > > can take that command and put it in a simple bash script:<br>
> >     > ><br>
> >     > >        #!/bin/bash<br>
> >     > >        syncevolution memotoo<br>
> >     > ><br>
> >     > ><br>
> >     > > It works as expected; no further input is needed.  However, when<br>
> >     I put<br>
> >     > > that script into my crontab, I get this error message:<br>
> >     > ><br>
> >     > >        Enter password for memotoo: [ERROR] error code from<br>
> >     > >        SyncEvolution fatal error (local, status 10500): could<br>
> >     not read<br>
> >     > >        password for memotoo<br>
> >     > ><br>
> >     > >        Synchronization failed, see<br>
> >     > ><br>
> >      /home/jtr/.cache/syncevolution/memotoo-2012-01-12-11-38/syncevolution-log.html<br>
> >     > >        for details.<br>
> >     > ><br>
> >     > > The error log simply repeats that it could not read the password.<br>
> >     > ><br>
> >     > > My scripting skills are limited; am I missing something?  If it<br>
> >     works<br>
> >     > > from a commandline should it not also work from cron?<br>
> >     ><br>
> >     > Cron uses different paths than a normal user. To avoid problems with<br>
> >     > this you should specify the full path to all executables and files in<br>
> >     > a cron job. You'll likely have to tell the program exactly where the<br>
> >     > config file is located.<br>
> ><br>
> >     Is this true even when the command in cron is a bash script?  The line<br>
> >     in crontab is:<br>
> ><br>
> >     1 23 * * * /home/jtr/bin/syncmemotoo<br>
> ><br>
> >     It runs every night at 11:00PM.<br>
> ><br>
> ><br>
> > But does your script need your environment?<br>
> > The absolute path gets your script, but under<br>
> > what environment does cron run it?<br>
> ><br>
> > The crontab(1) points out that a user can have<br>
> > their own crontab file, but seems a little vague<br>
> > about whether that implies anything about the<br>
> > user's own environment.<br>
> ><br>
> > Can you direct any error messages when<br>
> > the command is run to yourself?<br>
><br>
> By default, cron emails the output of commands to the user the command<br>
> was run as, or root if it's a system cron job.<br>
><br>
> So, the output of the command should be in his inbox.<br>
<br>
</div></div>The output of the command is as I mentioned: could not read password.<br>
<span><font color="#888888">-- <br></font></span></blockquote><div>So if root is running cron, then it's </div><div>"could not read" as in could not find?</div><div><br></div><div>So you can redirect the file containing</div>

<div>your password to your script?  Absolute</div><div>path.  I think everything at the end of the</div><div>crontab entry is your stuff, so you can </div><div>use "< file".</div><div><br></div><div>Or something thereabouts.  Do you use</div>

<div>a "read" commend in your script?</div><div><br></div><div>   -- Bob</div><div> </div></div>
<br />-- 
<br />This message has been scanned for viruses and
<br />dangerous content by
<a href="http://www.mailscanner.info/"><b>MailScanner</b></a>, and is
<br />believed to be clean.