Results 1 to 9 of 9
I want to set up a cron job to run this series of commands...
Code:
xterm -e "emerge sync && emerge -uDN && emerge depclean && revdep-rebuild"
I've heard this ...
- 06-24-2005 #1Linux Enthusiast
- Join Date
- Jun 2005
- Location
- Odessa, FL
- Posts
- 586
Need help setting up a cron job for updating
I want to set up a cron job to run this series of commands...
I've heard this (the series of emerge commands and revdep-rebuild) is the most effective way of doing it, as it syncs, updates, removes unnecessary files, and fills in any files that might have been needed when removing unnecessary files.Code:xterm -e "emerge sync && emerge -uDN && emerge depclean && revdep-rebuild"
so, what would i add to this command to make a non-root user run this (since only root can run emerge)? or, is there another way to allow a non-root user to run this? also, does this command look like it would work well...it did when i opened xterm, logged in as root, then typed the command exactly as is.
i really don't want to restart into X as a root each night so that i can run a cron job...i'm sure i would forget most of the time.
i've been looking for an answer to this for a while. i even looked through xterm's really long man pages for a command that might allow me to use root temporarily, but as i was rushing through it (the man pages are huge) i might've missed it if there is one. or maybe there isn't one..?
thanks in advance!
- 06-24-2005 #2
Make your regular user a member of the portage group. Then your regular user should be able to use emerge.
How to know if you are a geek.
when you respond to "get a life!" with "what's the URL?"
- Birger
New users read The FAQ
- 06-24-2005 #3Linux Enthusiast
- Join Date
- Jun 2005
- Location
- Odessa, FL
- Posts
- 586
I've never added a user to another group yet, but after reading up some it looks like I would do it like this....?
Originally Posted by budman7
does that look right?Code:usermod -G portage user
thanks for helping me!
EDIT: that looks like it worked!
- 06-24-2005 #4Linux Enthusiast
- Join Date
- Jun 2005
- Location
- Odessa, FL
- Posts
- 586
correction (looking back)...i think i was supposed to type all of the groups i want this user under, as i now can't "su -" into root
Originally Posted by josolanes 
i'll log in as root in another screen to fix this. i think i should've payed a little more attention
EDIT: yep, that fixed it...now i can log in as root again
- 06-24-2005 #5Just Joined!
- Join Date
- May 2005
- Location
- Huntington Beach, CA USA
- Posts
- 22
To add yourself to another group such as audio for example you would type gpasswd -a user audio.
You would replace user with your user name.
BTW, I think you would need to add the cron job as root or set your gentoo box with sudo. Although I would suggest you avoid doing what you are planning regularly as it is likely to break something on your box.
- 06-24-2005 #6Linux Enthusiast
- Join Date
- Jun 2005
- Location
- Odessa, FL
- Posts
- 586
would it really break it?
Originally Posted by ginsuedog
how would it break it? one of the commands not running correctly?
what set of commands would you recommend running? it just takes so long to update sometimes (if it's updating something huge like openoffice or xorg-x11)
thanks for bringing that up!
- 06-24-2005 #7Just Joined!
- Join Date
- May 2005
- Location
- Huntington Beach, CA USA
- Posts
- 22
Well I know that doing a deep clean on a Gentoo box is a very risky business for one Portage isn't perfect and sometimes a deep clean will remove a very important package that you need. Search the gentoo forums and you will see what I mean.
- 06-25-2005 #8Just Joined!
- Join Date
- May 2005
- Location
- Huntington Beach, CA USA
- Posts
- 22
The best way is to simply run your updates every few days. That way you do not have that many updates to compile at once. Most of the time you do not need to run with a --deep option. I have a cron job setup to run emerge --sync daily at 6:30am and then I normally just run emerge --update world every few days. Most of the time it doesn't take that long,maybe 20 to 30 minutes tops unless it is something big. Try emerge -av ccache, it will help speed you up somewhat.
- 06-25-2005 #9Linux Enthusiast
- Join Date
- Jun 2005
- Location
- Odessa, FL
- Posts
- 586
thanks for the advice

i'll update every few days...sounds like a good idea.
...and i'll deep clean every few weeks possibly. running it too often, i guess it can cause problems. i'll read up more on it soon.
thanks again!


Reply With Quote
