Tymestream Posted January 25, 2005 Report Share Posted January 25, 2005 Good Morning, I have been trying to set up a cron job for urpmi to update my sources (more an excercise in setting up cron jobs really) For learning purposes I am using Webmin to edit my cron jobs. This is what I have: /usr/sbin/urpmi.removemedia -a /usr/sbin/urpmi.addmedia --update updates ftp://ftp.sunet.se/pub/Linux/distributions/mandrakelinux/official/updates/10.1/main_updates with media_info/hdlist.cz /usr/sbin/urpmi.addmedia main ftp://gd.tuwien.ac.at/pub/linux/Mandrakelinux/official/10.1/i586/media/main with media_info/hdlist.cz /usr/sbin/urpmi.addmedia contrib ftp://ftp.surfnet.nl/pub/os/Linux/distr/Mandrakelinux/official/10.1/i586/media/contrib with media_info/hdlist.cz /usr/sbin/urpmi.addmedia plf ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandrake/10.1 with hdlist.cz This is the error I get: Output from command /usr/sbin/urpmi.removemedia -a /usr/sbin/urpmi.addmedia --update updates ftp://ftp.sunet.se/pub/Linux/distributions/mandrakelinux/official/updates/10.1/main_updates with media_info/hdlist.cz /usr/sbin/urpmi.addmedia main ftp://gd.tuwien.ac.at/pub/linux/Mandrakelinux/official/10.1/i586/media/main with media_info/hdlist.cz /usr/sbin/urpmi.addmedia contrib ftp://ftp.surfnet.nl/pub/os/Linux/distr/Mandrakelinux/official/10.1/i586/media/contrib with media_info/hdlist.cz /usr/sbin/urpmi.addmedia plf ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandrake/10.1 with hdlist.cz .. usage: urpmi.removemedia [-a] <name> ... where <name> is a medium name to remove. --help - print this help message. -a - select all media. -c - clean headers cache directory. -y - fuzzy match on media names. -q - quiet mode. -v - verbose mode. unknown options '--update' Maybe based on what you see you can tell me why this is not working. I do not know, for instance, if you can place multiple command in a cron job (seems to me you would have to be able too) and if so, how do you seperate the commands? (ie with a ; or a , or just a space) Finally, I know that webmin is just an interface for cron management, so it is adjusting an actual /etc/cron file, but I cannot find it in any of the cron directories. If I could see the actual file I am sure it would be helpful. Thanks again, Quote Link to comment Share on other sites More sharing options...
Guest anon Posted January 25, 2005 Report Share Posted January 25, 2005 You need to enter each one seperately in webmin AFAIK Each user has their own cron file so you will see different files for /you , /root, etc if they exist. To see what your cron jobs look like open a consol and: crontab -e this will either show you your current jobs or create the file. You could edit this file to look something like this: # * * * * * /usr/sbin/urpmi.addmedia --update updates ftp://ftp.sunet.se/pub/Linux/distributions/mandrakelinux/official/updates/10.1/main_updates with media_info/hdlist.cz # * * * * * /usr/sbin/urpmi.addmedia main ftp://gd.tuwien.ac.at/pub/linux/Mandrakelinux/official/10.1/i586/media/main with media_info/hdlist.cz etc, etc. then set up the times in webmin for each job. More info on cron: http://mandrakeusers.org/old_docs/admin/acron2.html Quote Link to comment Share on other sites More sharing options...
Tymestream Posted January 25, 2005 Author Report Share Posted January 25, 2005 You are a wealth of knowledge anon! Many thanks. Quote Link to comment Share on other sites More sharing options...
SurfahBoy808 Posted January 28, 2005 Report Share Posted January 28, 2005 for some reason when I set up a cron job with webmin, it seems like it doesn't execute it. I have a cron job that is suppose to "updatedb" every time I boot, but it doesn't do it. Cause it'll say my database is old and I have to manually update it myself. There are other things I've set as a cron and webmin wont execute it. Quote Link to comment Share on other sites More sharing options...
Guest anon Posted January 28, 2005 Report Share Posted January 28, 2005 When you click on "run now" does it execute? any errors listed in the output ? do you have permission to execute? Quote Link to comment Share on other sites More sharing options...
Tymestream Posted January 29, 2005 Author Report Share Posted January 29, 2005 In regards to the original message that I posted, while it is true that webmin requires seperate entries, it was very easy to work aroung this. Pointing a cron process to a bash script solved my problem very nicely. #!bash/sh /usr/sbin/urpmi.removemedia -a; /usr/sbin/urpmi.addmedia --update updates ftp://ftp.sunet.se/pub/Linux/distributions/mandrakelinux/official/updates/10. 1/main_updates with media_info/hdlist.cz; /usr/sbin/urpmi.addmedia main ftp://gd.tuwien.ac.at/pub/linux/Mandrakelinux/official/10.1/i586/media/main with media_in fo/hdlist.cz; /usr/sbin/urpmi.addmedia contrib ftp://ftp.surfnet.nl/pub/os/Linux/distr/Mandrakelinux/official/10.1/i586/media/contrib with media_info/hdlist.cz; /usr/sbin/urpmi.addmedia plf ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandrake/10.1 with hdlist.cz This has the added effect of making your crontab file easier and cleaner to read. Don't ya just love automating tasks Quote Link to comment Share on other sites More sharing options...
Guest anon Posted January 29, 2005 Report Share Posted January 29, 2005 Never thought of that ! B) Quote Link to comment Share on other sites More sharing options...
papaschtroumpf Posted January 31, 2005 Report Share Posted January 31, 2005 Never thought of that ! B) <{POST_SNAPBACK}> LOL! Quote Link to comment Share on other sites More sharing options...
SurfahBoy808 Posted February 24, 2005 Report Share Posted February 24, 2005 sorry for the long reply, but I found out that the webmin cron job "start on boot" doesn't work. So as long as I put a time to start, it works. I had to put updatedb as a cron. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.