LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-02-2007, 03:57 AM   #1
mayank_a
LQ Newbie
 
Registered: Oct 2005
Location: India
Distribution: RedHat 7.3, Fedora 4
Posts: 19

Rep: Reputation: 0
script in crontab do not execute or take proper environment of user


On a Linux machine running RH9 which I have only user permissions. I wish to copy a directory files and compile it before start of every day.
I scheduled a crontab job as such by crontab -e

MAILTO=""
SHELL=/bin/bash
0 10 * * * ~/daily.jobs

If I schedule simple commands as date >>~/x.txt. They get executed, but my script do not execute properly. It have executable flags also set for this file. When I try to print proper environment variables, it do not print $HOST in the script.

My daily.jobs script is as such;
#!/bin/bash
cd /hme/mayank/project/
cvs update -dP
make update
make


What can be the possible blotch for not execution of this file ??

Thanks and Regards
Mayank Agarwal
 
Old 07-02-2007, 06:03 AM   #2
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
Ensure somethings

Hi there!
I've got this problem too, and I found out that I missed a \n after crontab line I added. I mean, you'd ensure your crontabline ends with a newline character. Also you'd ensure /bin/bash exists and has executable flags.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab : why root can't execute ?? bluenectar Linux - General 2 03-12-2007 04:21 AM
Execute script as user sbassett Fedora 1 04-06-2005 11:30 AM
execute a script as a different user JordanH Linux - Software 3 02-08-2005 03:47 PM
how to execute firewall script as normal user robthebob Linux - Security 5 01-11-2005 05:36 PM
boot script execute command as non-root user wampfler Linux - Security 7 09-24-2004 05:56 AM


All times are GMT -5. The time now is 03:40 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration