The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
grep unix.com with google



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-26-2009
Registered User
 

Join Date: Sep 2009
Posts: 7
How to use <crontab> in linux

Hi all:

I try to set up crontab to run my script at certain time. but I had a problem.

basically, my script is located in my home directory of my linux machine.

before I run my actual script, I made an experiment. do:


Code:
crontab -e
* * * * * echo `who am i` >> ~/my.txt

and I got nothing in my.txt. The question is since the crontab doesn't recognize who am i, then I don't think it will run my actual script anyway.

how to solve this problem?

many thanks!
  #2 (permalink)  
Old 11-27-2009
Registered User
 

Join Date: Apr 2009
Location: /usr/bin/vim
Posts: 618
when you execute "who am i" in a batch process, you are getting nothing.,

try executing some other, and specify absolute path of it, you are likely to get output.

Code:
* * * * * /bin/ls >> ~/my.txt


sadly, the first job you tried itself is giving you trouble, but anyway thats how we learnt unix, enjoy here.
  #3 (permalink)  
Old 11-27-2009
Registered User
 

Join Date: Sep 2009
Posts: 7
Thanks for replying!

it did work for absolute path.

I also try echo $PATH, and I got /usr/bin:/bin, which is not my actual environmental variable. what need I do, my actual command need the proper environmental path. just need align the $PATH, then I don't have to attach the proper path every time I try to call some commands.


I am a newbie to linux, sorry to ask such silly quesions.

Thanks million!

Last edited by allenxiao7; 11-27-2009 at 02:08 PM..
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Crontab vaish.m.krishna UNIX for Dummies Questions & Answers 4 09-23-2008 06:39 AM
Need help in crontab? J_ang Shell Programming and Scripting 3 07-22-2006 02:46 PM
crontab karthikosu AIX 4 07-15-2006 10:10 PM
crontab sathiyamoorthy UNIX for Dummies Questions & Answers 1 04-21-2006 05:09 AM
crontab cuarem UNIX for Dummies Questions & Answers 4 10-08-2002 08:14 AM



All times are GMT -4. The time now is 10:29 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0