RSS
 

Posts Tagged ‘portage’

Holland on Gentoo

01 Aug

Introduction

There is a new king of backups in town, holland. This little framework written in Python allows one to easily backup anything that might need to be converted to a more flat file style before being backed up. Right now there is support for mysql, sqlite, and postgresql but with a little finesse it could potentially support directories as well as databases. This would make not only mysql backups a breeze but LDAP as well.

Progress Update

I have added a preliminary set of ebuilds to my overlay (which could use some code review if anyone is interested) that allows holland to easily be installed on Gentoo systems. So easy in fact that all it takes is emerge holland.

It accepts a set of use flags to bring in the “providers” you want to be able to backup for and makes sure that those packages are installed on the system.

Examples

The holland ebuilds have three providers right now:

  • mysql
  • postgresql
  • sqlite

You can install any of these three you want in any combination it doesn’t care. It will default to installing the mysql but can easily be told not to by placing -mysql in the use flags for holland. Diego Pettenò — Flameeyes mentioned to me that in EAPI 4 we’ll get the cool option of being able to specify one of a set of use flags must be set without forcing the choice but until then we have this slick solution.

There is also lvm support for snapshotting off the database directory before grabbing the database and a myriad of other features I haven’t had a chance to explore yet.

To perform a rudimentary backup after installing holland simply run holland bk. This will read the configurations in /etc/holland and backup the databases it finds.

Conclusion

The new kid on the block, holland, will make backups of complex databases and directories a breeze. Simply change that cronjob from using mysqldump to calling holland and you’re finished.

 
Comments Off

Posted in Linux Guides

 

Layman Overlay

11 Jan

My Overlay

My overlay has been available via subversion for quite some time now, but not in any easy to use format (integration with layman).  Getting this overlay to work with yours must have been a pain if you wanted to try something I had been working on.

Making My Overlay Available

The first thing I had to do to make my overlay talk with layman let alone get along with layman was add an xml definition of the overlay somewhere.  I chose the easy to manipulate path of http://www.alunduil.com/svn/portage/trunk/portage/alunduil-overlay.xml.

Adding My Overlay List to Your Layman

To add my overlay(s) to your layman list simply add the following path to your overlays variable in /etc/layman/layman.cfg: http://www.alunduil.com/svn/portage/trunk/portage/alunduil-overlay.xml.

 
Comments Off

Posted in Linux Guides

 

Cleaning /etc/portage/package.*

23 Jul

Inroduction

After a while the files in /etc/portage become cluttered with the common, “Let’s try this . . . whoops that didn’t work . . . let’s try this.” No matter how hard you try to keep this clean you have probably forgotten something along the way. Installing a testing package then removing it because you found a better one later, etc. Well what’s an easy way to clean these files up and make sure that we minimize their sizes and keep our Gentoo system crisp (or as crisp as we can by just managing these files)? I’ve written some bash one-liners that assist with this and could easily be adapted into a script that automates a lot of the cleaning for you.

In all of these scripts change the /etc/portage/package.use to the file you are interested in cleaning.

Checking for Multiple Occurrences of an Atom Within a File

for atom in $(gawk '{print $1}' /etc/portage/package.use); do [ "$(grep ${atom} /etc/portage/package.use | wc -l)" -gt "1" ] && echo "${atom}"; done

Checking for N Uses of a Use Flag in /etc/portage/package.use

I use this to move frequently used use flags to /etc/make.conf if it seems appropriate.

for flag in $(gawk '{print $2}' /etc/portage/package.use); do [ "$(grep "${flag}" /etc/portage/package.use | wc -l)" -gt "2" ] && echo "${flag}"; done

Checking for Removed Atoms Within a File

for atom in $(gawk '{print $1}' /etc/portage/package.use); do [ "$(portageq match / ${atom} | wc -l)" -lt "1" ] && echo "${atom}"; done
 
Comments Off

Posted in Linux Guides