[HCoop-Help] how to write to files using cron?

Davor Ocelic docelic at hcoop.net
Wed Dec 23 10:30:41 EST 2009


On Wed, 23 Dec 2009 08:41:48 -0500
Adam Chlipala <adamc at hcoop.net> wrote:

> Alexandre Santos wrote:
> > I'm having difficulties setting up a cron job, and would need some
> > help:
> >
> > The cron job launches a script that should append text to a file.
> > Here's an example in the .crontab:
> >
> > * * * * * run-in-pagsh --fg date date>>  $HOME/folder/file.txt
> >    
> 
> I think this is the result of a simple confusion: the ">>" notation
> is being interpreted by the initial shell process, not run inside a
> pagsh. Therefore, the file writing happens without AFS tokens.  You
> could fix the problem by putting the whole command to run inside a
> separate shell script, using some additional quoting, etc..

Hey,

Without reading everything in detail, I assume your folder/ has the
correct permissions for ochipepe.daemon:

  fsr sa ~/folder ochipepe.daemon write

After that is verified, adamc's comment looks like the probable
cause of your problem, so change your line to look like the
following:

* * * * * run-in-pagsh --fg date sh -c "date>>  $HOME/folder/file.txt"

Report your results,
-doc



More information about the HCoop-Help mailing list