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
> Using Cron As Non-root User...not Working
weslowsk
post Apr 30 2004, 11:12 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 30-April 04
Member No.: 2,870



Hi All,

not really a newbie, just really stumped & frustrated...I thought I knew cron but either I don't or it's not working properly...

here's the problem:

- trying to run a crontab as a non-root user

crontab cron_script

where cron_script is my crontab file;
after I do a:

crontab -l

it shows up fine there;

but when the time comes for the script to execute, it doesn't execute, and there is no log of the execution, nor an email sent to user indicating the status of the cron job

Here's what I've checked already:

/var/log/cron shows:

May 1 09:51:12 mysystem crontab[12695]: (myuser) REPLACE (myuser)
May 1 09:51:16 mysystem crontab[12696]: (myuser) LIST (myuser)
May 1 09:52:00 mysystem crond[12495]: (myuser) RELOAD (cron/myuser)

so, that shows that crond is allowing the non-root user to have a crontab

The frustrating part is that the root user CAN run exactly the same cron commands...

so, I thought it might have to do with a cron.deny or cron.allow file(s); well those parts seem to be working according to the documentation...
when neither file existed (which was by default), I was getting the same sort of stuff in my /var/log/cron file as shown above;
when the cron.allow file existed and was empty, myuser wasn't allowed to set a crontab, as shown by this snippet from /var/log/cron:

May 1 09:24:32 mysystem crontab[12457]: (myuser) AUTH (crontab command not allowed)

and finally, when I scrapped my cron.allow and put in a cron.deny (which was empty) and is now the current configuration, I was back to the original /var/log/cron messages I was getting before;

some stuff about my system:
Redhat Linux 7.1

rpm -qa | grep cron shows:

crontabs-1.9-2
anacron-2.3-16
vixie-cron-3.0.1-62

So, have I missed checking something? Is this a bug?

Thoughts? Ideas? Suggestions?

Kevin
Go to the top of the page
 
+Quote Post
Robert83
post May 5 2004, 06:55 AM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

could you please tell us what is the command your are trying to run with cron ?


Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
weslowsk
post May 5 2004, 08:02 AM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 30-April 04
Member No.: 2,870



I've tried various commands; initially, I had it running a "backup cleanup" script, and because I thought there was something wrong with script, I changed it to a simple "touch" command, to test out cron:

/home/myuser/backup_cleanup.bash

and, more recently:

/bin/touch /home/myuser/test.txt
Go to the top of the page
 
+Quote Post
hughesjr
post May 6 2004, 05:57 AM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



so, as the user, run the command:

crontab -e

and add this:

01 05 * * * /bin/touch /home/myuser/test.txt

then at 0501 you should see the cron has run.

You can substitute a different time ... say 2 minutes from your current time ... for testing


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
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 - 06:59 AM