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

Alexandre Santos ochipepe at hcoop.net
Wed Dec 23 08:38:12 EST 2009


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

But this is the output of the command:

/bin/sh: cannot create /afs/hcoop.net/user/o/oc/me/folder/file.txt:
Permission denied

Here are the permissions of the folder:

$ fs listacl ~/folder
Access list for /afs/hcoop.net/user/o/oc/me/folder is
Normal rights:
  system:administrators rlidwka
  me rlidwka
  me.daemon rlidwka

Also, and rather strangely, the file.txt can't be modified by
me.daemon, but can be created by it:

* * * * * run-in-pagsh --fg touch touch $HOME/folder/file.txt

yields:
$ ls -al file.txt
-rw-r--r-- 1 me.daemon nogroup 0 2009-12-22 20:54 file.txt

It's pretty confusing, me.daemon can create file.txt, but can't append
text to it. Of course, if I do it manually, it works...

How can I get the cron job to modify the file, instead of just
creating it via touch?

Cheers,
Alex



More information about the HCoop-Help mailing list