LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cron job (https://www.linuxquestions.org/questions/linux-newbie-8/cron-job-445207/)

rust8y 05-15-2006 10:29 PM

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 *

Jerre Cope 05-15-2006 11:01 PM

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

rust8y 05-18-2006 07:44 AM

How do I make the file executable?

RoughEdge 05-18-2006 09:06 AM

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.


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