shell library, originally factored out of the aeolus backup script