Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-15-2006, 10:29 PM   #1
Registered: May 2006
Posts: 100

Rep: Reputation: 15
Cron job

I need help to create a cron job

Cron job that runs daily every hour that does this:

cd /u1/database/prod/arch
chmod -R o+rw /u1/database/prod/arch
gzip -f -r *
Old 05-15-2006, 11:01 PM   #2
Jerre Cope
Registered: Oct 2003
Location: Texas (central)
Distribution: ubuntu,Slackware,knoppix
Posts: 323

Rep: Reputation: 37
First type all of those commands into a file and change the owner of the file to the user you expect to run the file. Make the file executable by that user.

Next read:

man cron


man 5 cron

The latter will show you the fields of the cron file and how to use them.

Login as the user to execute the cron and type:

crontab -l >my.crontab

Add this line to the file

0 * * * * /path_to_the_executable


crontab my.crontab

and cron will be updated

Type crontab -l to confirm your new line has been added.

(I had typed crontab -L, when I meant crontab -l ) --little ell

Last edited by Jerre Cope; 05-18-2006 at 10:59 PM.
Old 05-18-2006, 07:44 AM   #3
Registered: May 2006
Posts: 100

Original Poster
Rep: Reputation: 15
How do I make the file executable?
Old 05-18-2006, 09:06 AM   #4
Registered: Jan 2004
Location: Scotland
Distribution: Slackware 12
Posts: 67

Rep: Reputation: 15
try chmod 755 somefilehere

I am not sure if 755 is the ideal permission you want to set but man the chmod command to get a better idea of what you might want to set your permission level.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
cron job wbatzle Linux - Newbie 2 07-12-2005 04:19 PM
need help with cron job parthcorp1 Linux - General 2 02-01-2005 11:37 AM
cron job? dr_zayus69 Linux - Newbie 14 12-01-2004 06:16 PM
cron job working2hard Programming 6 07-28-2004 09:12 PM
Cron job T-Rex Linux - Newbie 1 09-26-2001 11:28 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration