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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-05-2011, 08:55 AM
|
#1
|
|
Member
Registered: Jun 2003
Location: Summit, NJ
Distribution: CentOS 5.4
Posts: 110
Rep:
|
cron backup job fails to run
hey LQ!
long time no hear!  I'm having a small issue where the backup jobs
that I set to run in the crontab of the backup user do not appear to
be running. Here's how I set it up (with crontab -e as the backup
user):
run amanda every night (check at 2:45 and backup at 3)
Code:
45 2 * * * /usr/sbin/amcheck 1>> /var/log/amanda/crontab/amcheck.log
* 3 * * * /usr/sbin/amdump 1>> /var/log/amanda/crontab/amdump.log
The executables are where they are supposed to be and run if you type
them in on the command line:
Code:
[amandabackup@amanda ~]$ ls -l /usr/sbin/amcheck
-rwsr-x--- 1 root disk 68624 Dec 29 14:08 /usr/sbin/amcheck
and
Code:
[amandabackup@amanda ~]$ ls -l /usr/sbin/amdump
-rwxr-xr-x 1 amandabackup disk 9637 Dec 29 14:08 /usr/sbin/amdump
both do actually work!
Although I'm not sure what the 's' indicates in the permissions of amcheck.
And here's a tail of the cron logs
Code:
[root@amanda init.d]# tail /var/log/cron
Jan 5 07:01:01 newamanda crond[13612]: (root) CMD (run-parts /etc/cron.hourly)
Jan 5 07:17:09 newamanda crontab[13652]: (amandabackup) BEGIN EDIT
(amandabackup)
Jan 5 07:18:00 newamanda crontab[13652]: (amandabackup) REPLACE (amandabackup)
Jan 5 07:18:00 newamanda crontab[13652]: (amandabackup) END EDIT (amandabackup)
Jan 5 07:18:01 newamanda crond[1448]: (amandabackup) RELOAD (cron/amandabackup)
Jan 5 07:18:39 newamanda crond[13686]: (CRON) STARTUP (V5.0)
Jan 5 07:23:01 newamanda crontab[13699]: (amandabackup) BEGIN EDIT
(amandabackup)
Jan 5 07:23:47 newamanda crontab[13699]: (amandabackup) END EDIT (amandabackup)
Jan 5 07:25:38 newamanda crontab[13751]: (amandabackup) BEGIN EDIT
(amandabackup)
Jan 5 07:25:53 newamanda crontab[13751]: (amandabackup) END EDIT (amandabackup)
And the cron daemon is running:
Code:
bluethundr@amanda:~/rpm$ sudo ps -ef | grep cron
root 13686 1 0 07:18 ? 00:00:00 crond
1001 14318 14274 0 09:51 pts/3 00:00:00 grep --color=auto cron
I would certainly appreciate any thoughts on this situation that you might be willing to share!

|
|
|
|
01-05-2011, 09:21 AM
|
#2
|
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,314
|
Some remarks:
will mean each minute from 03:00 to 03:59. If it should happen only one time, the minute must be specified.
Code:
[amandabackup@amanda ~]$ ls -l /usr/sbin/amcheck
-rwsr-x--- 1 root disk 68624 Dec 29 14:08 /usr/sbin/amcheck
The 's' means "set uid" and it will run as the root user, even when it's started by an ordinary user. To check that cron on its own is working fine, can you define a script:
Code:
#!/bin/sh
date >> $HOME/logfile
(make it executable) and check the output? To test this the above rule with an asterisk for the minute is perfect.
|
|
|
|
01-05-2011, 12:42 PM
|
#3
|
|
LQ Newbie
Registered: Jan 2011
Location: Chicago, Il. USA
Distribution: Ubuntu
Posts: 4
Rep:
|
Some more considerations:
Your command...
[root@amanda init.d]# tail /var/log/cron
...doesn't show us the relevant time from the cron log file. In other words, your tail starts with the time 07:01:01 A.M., but the time we need to see is around 2:45 - 4am. If that time frame isn't in the current cron log file, it might have been rotated out. Look for files like cron.1, cron.2 and look (more, less, cat, etc.) through those files.
Second, did the cron job create a /var/log/amanda/crontab/amcheck.log or /var/log/amanda/crontab/amdump.log file? What's in them?
Hoping that helps...
|
|
|
|
01-05-2011, 08:33 PM
|
#4
|
|
Senior Member
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,189
Rep: 
|
Just a couple of comments.
Presuming you work in the daytime, there is not much point in running amcheck at 2:45am and then running amdump at 3:00am (assuming you meant to do "0 3 * * *"), since there is no one around to respond to the amcheck. Typically, you would run amcheck around 15:00 in the afternoon so that you can do something about any issues there might be and not have an amdump fail in the middle of the night.
Second, is your configuration actually named "1"? amcheck and amdump take at least the name of the configuration as an argument. Typically, that would be something like "daily", and your command would be `amcheck daily`.
Third, you are routing the output to /var/log/amanda/crontab/amcheck.log and amdump.log. Is there anything in those files after your run? I'm inclined to think not, because amcheck and amdump, when run from cron, typically spawn off as daemon like processes and send you a report by email. Your email should be in the amanda.conf in the configuration directory.
Can you tell us anything about your installation and configuration of Amanda?
|
|
|
|
01-06-2011, 03:35 AM
|
#5
|
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,314
|
Quote:
Originally Posted by choogendyk
Second, is your configuration actually named "1"?
|
AFAICS the 1>> is the same like >> and referring to stdout. So this should be fine.
|
|
|
|
01-06-2011, 05:50 AM
|
#6
|
|
Senior Member
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,189
Rep: 
|
Quote:
Originally Posted by Reuti
AFAICS the 1>> is the same like >> and referring to stdout. So this should be fine.
|
Of course. I was looking for the required argument and missed the lack of a space there. Typically, one wouldn't need or put the 1 there, since it is assumed.
Anyway, that clarifies that the commands are missing the required argument, which is the name of the configuration that they are to run. Since they are designed to run in background from cron and send reports via email, I would just get rid of all the extraneous >> stuff.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:10 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|