Download your favorite Linux distribution at LQ ISO.
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 12-19-2003, 04:08 PM   #1
Registered: Oct 2003
Location: East Anglia, England
Distribution: Dapper Drake / Slackware
Posts: 151

Rep: Reputation: 30
CRON question.

Hi, I have been reading up about cron; the daemon which carries out tasks in the background at set intervals. However, there is one part for which I would be grateful for some clafication on; how to actually make the scripts and where to put them.

Say for instance, I want to back up all the files in my home directory into a tar.gz on a Friday afternoon every other week at 5:00pm. As long as I have that one example, I think I could work through any other task after that.
Old 12-19-2003, 05:15 PM   #2
Registered: Feb 2003
Location: Los Angeles
Distribution: Red Hat 8.0
Posts: 68

Rep: Reputation: 15
This is what I do for unix:

in the command prompt type "crontab -e"

this puts you into a cron text file in the default text editor. Mine is vi.

Then on the first line you schedule the script ie:

"0 12 * 2 2 sh /home/user/"

the first number is the number of minutes past the hour

the second number is the number of hours ie 12= noon.

the third number is the day of the month

the fourth number is the month of the year

the day of the week ie sun=0

you can subsitute each number with a * as a wildcard.

The above example scheduled the script at 12 noon, every tuesday in february.

hope this helps. eastj
Old 12-20-2003, 06:38 AM   #3
Registered: Oct 2003
Location: East Anglia, England
Distribution: Dapper Drake / Slackware
Posts: 151

Original Poster
Rep: Reputation: 30
Thanks eastj!


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 question aurelio26 Linux - Newbie 2 09-16-2004 04:19 PM
cron question paperdiesel Linux - Newbie 2 10-29-2003 04:28 PM
Cron question sketch7 Linux - General 1 09-10-2003 09:03 PM
Cron question. Thetargos Linux - Software 1 07-19-2003 07:19 AM
Cron Question Stephanie Linux - General 1 06-29-2001 04:02 PM > Forums > Linux Forums > Linux - Newbie

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