LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-05-2004, 11:58 AM   #1
byfaithalone
LQ Newbie
 
Registered: Sep 2003
Location: Little Rock, AR
Distribution: SUSE 8.2
Posts: 23

Rep: Reputation: 15
Setting up crontab SUSE Linux 8.2


Here is my delima: I am a newbie to Linux and I have racked my brain trying to setup a simple cron job to perform a backup on my machine. My administrative doc states that /etc/c rontab cannot be processed with crontab -e. When I attempt to do this my editor opens, I include the following line:

5 1 * * * /usr/bin/scripts/run-backup

I am then asked to save the crontab with a name of crontab.xxxxx and they are stored in the /tmp directory. Why is the temp file being generated?

I then tried to modify the root user in /var/spool/cron/tabs to include this line:

5 1 * * * root /usr/bin/scripts/run-backup

This failed to work as well

I then tried to create a crontab file from the root profile and store it in /etc/cron.daily

Another failure

Can anyone offer me any step by step assistance? I have review admin doc for SUSE and other sites via Google and cannot find anything definitive to my OS.
 
Old 02-05-2004, 12:04 PM   #2
Gates1026
Member
 
Registered: Sep 2003
Location: Iowa
Distribution: Slackware 9.1
Posts: 155

Rep: Reputation: 30
For cron jobs I usually just do the following:

edit a file with filename of your choice (ex: vim cronjobs)

Enter in your cron info, for example to backup my /home/<username> directory I do

30 13 * * * tar -cvf /backup/daybackup.tar /home/<username>/*

Then as root I would do # crontab cronjobs

This may not be what you are looking for, let me know if it isn't
 
Old 02-05-2004, 12:13 PM   #3
jazernorth
Member
 
Registered: Jan 2004
Location: Green Bay
Distribution: RedHat 8.0, LFS-5.0
Posts: 100

Rep: Reputation: 15
I know you are not supposed to change '/etc/crontab' this way, but I 'su' as root then edit the crontab file.

You will also need to make sure the script '/usr/bin/scripts/run-backup' works as required manually. Then it should work. Most put all cron jobs in '/etc/cron./*', then leave the crontab file alone. So that the cron job will use crontab to run anything in '/etc/cron.*/'

JN
 
Old 02-05-2004, 12:23 PM   #4
byfaithalone
LQ Newbie
 
Registered: Sep 2003
Location: Little Rock, AR
Distribution: SUSE 8.2
Posts: 23

Original Poster
Rep: Reputation: 15
Thanks for the feedback. I will attempt follow your recommendations and give you an update soon.
 
Old 02-05-2004, 01:10 PM   #5
t3___
Member
 
Registered: Sep 2003
Posts: 240

Rep: Reputation: 30
if you are new, I would also suggest trying webmin (www.webmin.com). you may already have it installed on your system as it is included in many distros. to launch webmin, enter https://localhost:10000 in your favorite browser. Its cron scheduling agent is really easy to use.

T
 
Old 02-05-2004, 01:46 PM   #6
byfaithalone
LQ Newbie
 
Registered: Sep 2003
Location: Little Rock, AR
Distribution: SUSE 8.2
Posts: 23

Original Poster
Rep: Reputation: 15
Attempted to install webmin package via YAST2. Package was installed succesfully.

When I attempted to start the service here is message I recieved:

Start:

/etc/init.d/webmin start returned 127 (Unspecified error.)

Stop:

/etc/init.d/webmin stop returned 127 (Unspecified error.)
/etc/init.d/webmin: line 30: /etc/webmin/stop: No such file or directory

Refresh:

/etc/init.d/webmin status returned 1 (Program is dead and /var/run pid file exists.)
grep: /etc/webmin/miniserv.conf: No such file or directory
Webmin is stopped

/etc/init.d/webmin: line 30: /etc/webmin/stop: No such file or directory

I am not sure where to proceed as a result.
 
Old 02-05-2004, 04:42 PM   #7
byfaithalone
LQ Newbie
 
Registered: Sep 2003
Location: Little Rock, AR
Distribution: SUSE 8.2
Posts: 23

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Gates1026
For cron jobs I usually just do the following:

edit a file with filename of your choice (ex: vim cronjobs)

Enter in your cron info, for example to backup my /home/<username> directory I do

30 13 * * * tar -cvf /backup/daybackup.tar /home/<username>/*

Then as root I would do # crontab cronjobs

This may not be what you are looking for, let me know if it isn't
I attempted to do this for a new file. When I executed the crontab at command line it updated my the user "root" file at var/spool/cron/tabs/root, but never executed the shell script.

Next I will try to put my backup script in the etc/cron.daily/ and see if it get's run automatically.
 
  


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
problems setting the user in crontab p.gaic Linux - Software 1 07-15-2005 12:07 AM
setting up suse linux lolinux Linux - Newbie 4 10-22-2003 04:38 PM
Setting global variables from a crontab job davee Programming 2 10-06-2003 08:05 AM
Suse 8.1 crontab problem? naflan Linux - Software 1 05-26-2003 01:05 AM
Setting up email from SuSe Linux 8.1 JOHN RYRIE Linux - Newbie 1 11-13-2002 10:58 AM


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