How to create a crontab


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to create a crontab
# 1  
Old 01-28-2010
How to create a crontab

Hi,

I would like to execute a script every 2 minutes, I think cron is the perfect tool for that but I don't know how to use it. Someone could help me ?
# 2  
Old 01-28-2010
Hello!

Per forum rules, and the benefit of all users, please search the network and the forums before posting a question.

You can easily search the forums using our internal Google search engine or our advanced internal search engine. You can also search our huge UNIX and Linux database by user generated tags or search the database for unanswered questions and provide an answer.

Check this link:

https://www.unix.com/answers-frequent...n-crontab.html

Thank you.

The UNIX and Linux Forums
# 3  
Old 01-28-2010
I did some research, but I don't understand how to create a crontab file ... Could you please tell me how to do it step by step ... I did : "crontab -e", wrote in "*/2 * * * * /myscript.sh" but how to save it ?
# 4  
Old 01-28-2010
What Operating System are you using?
Are you user "root" or another user? It matters.
Has your Systems Administrator given you unix permissions use cron?


What is the value of these variables:

echo "${EDITOR}"
echo "${TERM}"
# 5  
Old 01-28-2010
I'm using OpenSuse 11.2 and I'm Root user. Concerning the variables, how to know it ?
# 6  
Old 01-28-2010
In Unix the value of ${EDITOR} is the name of the editor you will use when using the crontab command (usually "vi" - in which case you save with ":wq!").
As this is Linux not Unix, I'll leave the question to a Linux expert.
# 7  
Old 01-28-2010
I progressed ! But I still need some help ...
So I created a .cron file containing this :

Quote:
SHELL=/bin/sh
PATH=/home
HOME=/

# canardwc.cron
#Min. Heures Jours Mois JourSemaine
*/5 * * * * /winneuf.sh
I did "crontab /canardwc.cron". That command installed the crontab. Everything seems okay, but the script is not lunched ! Why ?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to create variables to pass into a bash loop to create a download link

I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies

2. AIX

Ask Step create crontab

dear master, I have a question about crontab, I trying create a file. #touch myfile #vi myfile errpt >> reporterror /mydirectory that content myfile. and I try, insert at crontab -e 45 14 * * * /myderectory/myfile >> /mydirectory ... (13 Replies)
Discussion started by: williamen
13 Replies

3. Shell Programming and Scripting

crontab

would like to run job on Unix crontab, every 10 minutes EXCEPT between 4:30 am and 4:45 am. Please help me out, how would I do. Thanks Jhonny (2 Replies)
Discussion started by: jhonnyrip
2 Replies

4. Homework & Coursework Questions

Create script to add user and create directory

first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies

5. UNIX for Dummies Questions & Answers

crontab

Hi All, Can any one please help in setting up crontab where the crontab entries are in a file say "crontabentries" How to delete the crontab entries and how to register a file to crontab. thanks Satish (1 Reply)
Discussion started by: thaduka
1 Replies

6. UNIX for Advanced & Expert Users

SZ in crontab

Dear friends, sz command transfer files from unix to hyperterminal (in WINDOWS OS) CRONTAB is used for jobs periodically can we use sz command in the crontab in UNIX Operating systems ? If so plz guide me, as iam unable to put sz command in crontab ... (1 Reply)
Discussion started by: manikumar
1 Replies

7. UNIX for Advanced & Expert Users

Crontab

Hai , the working the path and representation of crontab application will differs from flavour to flavour in linux if so will any one plz tell me how it differs . its urgent :confused: Regards Sanju (1 Reply)
Discussion started by: sanjustudy
1 Replies

8. UNIX for Dummies Questions & Answers

crontab help

Hi All, Please help me in understanding the crontab entries and also below queries 1. how can we set a crontab entry 2. from where the cronjob will run( if default) 3. you can we specify the location from which the cronjob should run. 4. how can we capture the output of the cronjob. ... (8 Replies)
Discussion started by: thaduka
8 Replies

9. UNIX for Dummies Questions & Answers

crontab

Hi I have a shell script which works fine at the command line and does works in crontab also but does not send the output to mail as other scripts do by default. 10 1 * * * /export/home/test/report_script by default should send the output to mail but the script runs OK and the output... (1 Reply)
Discussion started by: run_time_error
1 Replies

10. UNIX Desktop Questions & Answers

How do I create desktop icons for the shell programs I create???

I am a bash shell programmer and I create programs on occasional basis. Now, I dont want my programs to be run by typing out its name at a command line. I want to make it as user friendly as possible. I want to create icons on the desktop so users can click on it. mind you, I said "desktop... (7 Replies)
Discussion started by: TRUEST
7 Replies
Login or Register to Ask a Question