Jump to content

Photo

Automatic system updates?


2 replies to this topic

#1
paddymac

paddymac

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

I was thinking earlier today that it would be nice if there were some way to have a Funtoo system automatically update periodically. It wouldn't have to be anything complex -- maybe just a shell script periodically run by cron. In fact, it would be easy to set up a cron job to periodically sync the Portage tree and run 'emerge -1uDNv --with-bdeps=y @world' or a similar command. But what if there were some kind of error that required human interaction? Then it would need to detect that error and notify the user -- perhaps by sending a system message to the root user or something. I was just wondering if something like that was already available or if any users had set up anything of the sort on their own systems.



#2
sputnik

sputnik

    Advanced Member

  • Members
  • PipPipPip
  • 117 posts

I do exactly that with a bash script, but it is QUITE complex for many assorted reasons.  I have several computers updated by the one script.  Issues are: I don't allow root ssh access, so workarounds for that.  I also backup all computers nightly with it.  1 computer is the ringleader, it's on 24/7.  Different computers have different needs.  On and on...

But not to discourage you, I love it.  It took about 1.5 years to get it more or less right, it's the biggest mess of spaghetti you can imagine and even minor changes have great potential to upset the apple cart.  Oh, and I don't bother trying to catch every error that needs human intervention, early on I realized 1.  That would be impossible.  2.  After taking care of the obvious things it's rare that it doesn't work, when that happens the human intervenes, things will work the next night  :P

I was going to convert it to python but 1.  I'm lame at python.  2.  I fear the inevitable minor changes  3.  It doesn't have to be fast or cool

It does everything including updating eix on all computers, doing emerge @preserved-rebuild when needed, the only thing I left for the human was emerge --depclean and revdep-rebuild, I do that 1st thing in the morning so the "human" can see what's up.  Logs are kept, there are no mysteries.  It is set as a cron job after my normal bedtime but I can run it directly and override the cron job, which I almost always do.  Turns computers on for the update/backup, turns them off when done, makes kernels (I have to update the config 1st of course), lots of stuff.

About 3 years now, never any great problem, of course, growing pains the 1st 1.5 years.



#3
fsociety

fsociety

    Newbie

  • Members
  • Pip
  • 3 posts

https://pypi.python....w.emerge_update

 

If you didn't know, there is quite the fancy python script hidden in pip/Pypy for updates.

 

I'm in the midst of writing a python script that can detect what is going and update accordingly.  I'll post it when I've completed it.  Hopefully soon.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users