LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-08-2008, 04:31 AM   #1
panselva
LQ Newbie
 
Registered: May 2008
Posts: 1

Rep: Reputation: 0
Smile how to run crontab in shell script


hi! I would like to know how to run crontab in shell script.
pls help me
 
Old 05-08-2008, 05:27 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
You don't. What are you trying to achieve?
 
Old 05-08-2008, 05:42 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Moved: This thread is more suitable in Linux General forum and has been moved accordingly to help your thread/question get the exposure it deserves.


Quote:
Originally Posted by Simon Bridge View Post
You don't.
Why not?


Quote:
Originally Posted by panselva View Post
I would like to know how to run crontab in shell script.
Hello and welcome to LQ. Next time please post what you've tried, that makes it easier for us to see how to guide you. Editing a users crontab is easy but requires some steps: 0) list the crontab and output to a temporary file, 1) append the lines you need to the temporary file, 2) run 'crontab temporaryfilename' to make changes stick. You can find the crontab commands in 'man 1 crontab'.
 
Old 05-08-2008, 08:33 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
As per SB, I'd ask what the OP actually wants to do.
Sounds like he wants to run a cmd from his crontab at the cmd line, which would just be a copy-paste, ignoring the timing string.
To change a crontab, just use
crontab -e
as the relevant user. No need to mess with temp files etc.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
my database export shell script run from command line but not form crontab saifee Linux - General 11 01-29-2012 09:24 AM
crontab job and run on shell sunhui Linux - Software 1 02-13-2007 05:35 AM
Script doesn't run in crontab dani81 Linux - General 1 11-16-2004 03:42 AM
Shell script running via crontab problem. thetruethugg Linux - Software 13 12-19-2003 08:56 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 - General

All times are GMT -5. The time now is 01:14 AM.

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