LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 06-06-2010, 10:37 PM   #1
xiutuo
Member
 
Registered: Mar 2008
Posts: 55

Rep: Reputation: 15
create a crontab job by bash script issue


i want to create a crontab job by bash scripts:test1
cat /opt/shell/test1
crontab on
* * * * * /opt/shell/test1
chmod 711
/opt/shell/test1

this job * * * * * /opt/shell/test1 had not been added,

why? but i do not want to use this command line ( crontab -e )to add this job

get me a hint ,thx,
 
Old 06-07-2010, 12:06 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Code:
crontab -u [username] -l > [outputfile]
echo '* * * * * /opt/shell/test1' >> [outputfile]
crontab -u [username] [outputfile]
 
Old 06-07-2010, 12:21 AM   #3
xiutuo
Member
 
Registered: Mar 2008
Posts: 55

Original Poster
Rep: Reputation: 15
thx ,it works ,
why "crontab on" did not work ,still confuse...
 
Old 06-07-2010, 10:31 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
There is no command "crontab on".
 
Old 06-07-2010, 10:54 PM   #5
xiutuo
Member
 
Registered: Mar 2008
Posts: 55

Original Poster
Rep: Reputation: 15
is there other way to do this?

thx
 
  


Reply

Tags
bash, crontab



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 and a bash script seefor Linux - General 6 01-27-2009 03:41 PM
removing # from crontab (bash script) inderpunj Programming 4 10-13-2008 02:34 PM
Bash script not running within crontab job WrightExposure Linux - General 3 01-23-2007 06:28 PM
Using crontab in a bash script nro Linux - Newbie 3 08-26-2005 08:04 PM
adding a job to crontab via shell script tazio Linux - General 7 10-23-2003 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:23 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration