Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> cron file writing permission problem
TheGuyGuy
post Jul 30 2006, 09:15 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 30-July 06
Member No.: 6,874



In cron, I execute:

*/1 * * * * echo "hello" > $HOME/hello

...and in e-mail I get a permission error:

/bin/sh: line 1: [my home path]/hello: Permission denied

Why?

Similarly, I run a perl script in cron (instead of redirecting output from a command), and in the perl script, I try both redirecting STDOUT to a file and simply opening a file for write, and I also get a "Permission denied".

I check the user ID and the group ID, both in cron and in the perl script, and they are normal (my user ID and group ID). (I am not root.)

I run the script in the shell and it works like a charm (and of course echo works, too). No, I don't use any weirdo environment variables in the script.

It kind of baffles my mind how the result can be different if the uid and gid are the same.

I am not using setuid or anything of that nature to my knowledge.

The server is a RedHat Enterprise 3.0 server running on an i686 chip of some kind.

I haven't the foggiest what is going on, but it's pretty aggravating. Thanks for any help,

TheGuyGuy
Go to the top of the page
 
+Quote Post
markjr
post Jul 30 2006, 10:33 PM
Post #2


./configure
***

Group: Admin
Posts: 62
Joined: 9-February 06
Member No.: 6,054



QUOTE (TheGuyGuy @ Jul 30 2006, 10:15 PM) *
In cron, I execute:

*/1 * * * * echo "hello" > $HOME/hello

...and in e-mail I get a permission error:

/bin/sh: line 1: [my home path]/hello: Permission denied

Why?


Off the top of my head, I'm guessing $HOME isn't set in your crontab environment.

Try this:

*/1 * * * * echo "home is:$HOME"; echo "hello" > $HOME/hello

and see what shows up for $HOME in your email error report
Go to the top of the page
 
+Quote Post
TheGuyGuy
post Jul 30 2006, 10:42 PM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 30-July 06
Member No.: 6,874



QUOTE (markjr @ Jul 30 2006, 11:33 PM) *
Off the top of my head, I'm guessing $HOME isn't set in your crontab environment.

Try this:

*/1 * * * * echo "home is:$HOME"; echo "hello" > $HOME/hello

and see what shows up for $HOME in your email error report


Result is:

home is:[my home directory -- which I am censoring]
[again my home directory]/hello: Permission denied.

It's set.

TheGuyGuy
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 15th December 2017 - 10:16 PM