LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   create a crontab job by bash script issue (http://www.linuxquestions.org/questions/linux-server-73/create-a-crontab-job-by-bash-script-issue-812584/)

xiutuo 06-06-2010 11:37 PM

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,

unSpawn 06-07-2010 01:06 AM

Code:

crontab -u [username] -l > [outputfile]
echo '* * * * * /opt/shell/test1' >> [outputfile]
crontab -u [username] [outputfile]


xiutuo 06-07-2010 01:21 AM

thx ,it works ,
why "crontab on" did not work ,still confuse...

unSpawn 06-07-2010 11:31 AM

There is no command "crontab on".

xiutuo 06-07-2010 11:54 PM

is there other way to do this?

thx


All times are GMT -5. The time now is 01:36 PM.