Jump to content

Scheduled job not running


Recommended Posts

Here is a script that I have in /etc/cron.daily called secupdate:

 

#!/bin/bash
#
/usr/sbin/urpmi.update -a
/usr/sbin/urpmi --auto-select --auto

 

originally I just had the script like this below, but thought it might not be running due to a path problem:

 

#!/bin/bash
#
urpmi.update -a
urpmi --auto-select --auto

 

however, it still didn't work. I made the script executable by doing this:

 

chmod +x secupdate
ls -l secupdate
-rwxr-xr-x 1 root root 77 May 4 09:01 secupdate*

 

and I rechecked this in case something was wrong, but no matter what this script will not run automatically. My crond service and also atd service are running fine, so not sure why it won't run. Any ideas?

Link to comment
Share on other sites

I made the script executable by doing this:

 

chmod +x secupdate
ls -l secupdate
-rwxr-xr-x 1 root root 77 May 4 09:01 secupdate*

 

Hi.

 

I have the update.cron in the same place as yours, and it works just fine.

I have set it to -rwxr-xr-x like yours. I noticed that when I made another scheduled script that didn't have .cron, it didn't work. I know there are other scripts like "logrotate" and "rpm" without .cron and they work just fine (at least I think so).

 

But my update script looks like this:

#! /bin/bash
urpmi.update -a
urpmi --auto --auto-select

 

I don't know if "--auto" and "--auto-select" need to be in that order, but I think it's worth trying.

What does your log say about it?

Link to comment
Share on other sites

Nothing in any log files. I checked these too, no errors, nothing. I'll add the cron to the end and see if it makes a difference.

 

I can execute it manually, and it works perfectly fine, so the ordering of --auto and --auto-select isn't too important. Just the automation of it is failing.

 

I'll update tomorrow after the addition of .cron to the filename = secupdate.cron. If anyone has any further ideas as to why, love to hear them.

Link to comment
Share on other sites

Well, I don't add it to crontab as such. Effectively, it's usually enough to create a script and then drop in /etc/cron.daily. These jobs are then ran at 4am each morning.

 

I've renamed it as previously suggested to secupdate.cron, instead of the previous name secupdate. I've been waiting for some updates to be released to see if they get applied (looking for advisories on here). Once these are updated, I'll know for sure if it's working or not, because I'll manually run it, and see if updates get applied. If they don't, then I know it's working, but if they do, then I know it's not been doing anything at 4am in the morning.

 

There are already jobs in this directory, so am pretty sure it's running these, even though I don't actually get any mail output because I'm not using the server for mail purpose or mail notification.

 

I've just seen the advisories that paul has posted with regards to gdm, etc, so should definitely know tomorrow what is going on. I'm not sure how to check crontab as such, but the service is running.

Link to comment
Share on other sites

I've been waiting for some updates to be released to see if they get applied (looking for advisories on here). Once these are updated, I'll know for sure if it's working or not, because I'll manually run it, and see if updates get applied. If they don't, then I know it's working, but if they do, then I know it's not been doing anything at 4am in the morning.

 

You don't need to wait, just execute the script from /etc/cron.daily with ./secupdate.cron and you'll see if it works (it doesn't give any output there) and then check out the logfile at /var/log/urpmi.log. Mine says:

Sun May 7 04:08:11 2006 urpmi called with --auto --auto-select

Mon May 8 04:09:58 2006 urpmi called with --auto --auto-select

Tue May 9 04:14:03 2006 urpmi called with --auto --auto-select

Wed May 10 04:09:33 2006 urpmi called with --auto --auto-select

 

If you can see the same, you can be sure it's working.

Link to comment
Share on other sites

It does work manually, I mentioned this in Post #3 of this thread. It's the automated function that doesn't seem to be.

 

I just checked my urpmi.log and it did run on May 7, which was the morning before I created this post.

 

Strange. I'm pretty sure it wasn't working :P

 

I'll keep you posted tomorrow.

 

EDIT:

 

Just checked the previous logs that got gzipped, and they too also show it was working. God knows why I thought it wasn't! :o

Link to comment
Share on other sites

Just to confirm, I renamed it back to "secupdate", and I checked the urpmi.log this morning, and configured it's running fine. The two updates that were released yesterday for gdm and gzip were downloaded and installed.

 

Many thanks guys for all your help, even though it was working already. Damn I feel stupid :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...