LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices



Reply
 
Search this Thread
Old 05-15-2006, 11:29 PM   #1
rust8y
Member
 
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-16-2006, 12:01 AM   #2
Jerre Cope
Member
 
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

and

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

Type:

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 11:59 PM.
 
Old 05-18-2006, 08:44 AM   #3
rust8y
Member
 
Registered: May 2006
Posts: 100

Original Poster
Rep: Reputation: 15
How do I make the file executable?
 
Old 05-18-2006, 10:06 AM   #4
RoughEdge
Member
 
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.
 
  


Reply


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


All times are GMT -5. The time now is 09:39 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration