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

Alexandre Santos ochipepe at hcoop.net
Wed Dec 23 16:20:20 EST 2009


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

yup

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

I tried both approaches:

1 - encapsulating the command in quotes
If I modify .crontab:
run-in-pagsh --fg date sh -c "date >> $HOME/folder/file.txt"

it outputs by mail:
Wed Dec 23 15:38:02 EST 2009

but leaves the file.txt empty

2 - encapsulating the command in a script file
in .crontab:
* * * * * run-in-pagsh --fg script script

the script file:
date >> ~/folder/file.txt

This works fine, there is not mail output, and the date is registered
in file.txt

So I guess I just should avoid having more than the name of the script
in the .crontab run-in-pgash invocation.

Cheers,
Alex



More information about the HCoop-Help mailing list