Hi, I''m using the ''backup'' parameter in file resources to backup to a central filebucket on the puppetmaster. How do I restore a backup? I couldn''t find anything in the wiki, but saw some docs by running ''filebucket --help''. It says to restore a backed up file, you need to know the md5sum. Unfortunately, AFAIK the only place this information is stored is in the puppet logs, which in my case are rotated and deleted regularly. Does this mean I have a ton of backed up files, just no index to find the specific one I want? I assumed there would be some sort of restoration command I could run either from the client or server to list which backups are available and let me choose which one to restore. Something like: filebucket --server mypuppetserver --node mynode --file /etc/passwd /home/johnp/restored_passwd would return [1] <md5sum here> 8192b Dec 03 07:14 [2] <md5sum here> 9012b Jan 15 08:19 [3] <md5sum here> 9489b Jan 28 10:20 Select file to restore [1-3]: Anyway, am I out of luck restoring backups without knowing the md5sum of the file I want to retreive? Thanks. ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
On Feb 5, 2008, at 4:35 PM, John Philips wrote:> > Anyway, am I out of luck restoring backups without > knowing the md5sum of the file I want to retreive?Well, Puppet doesn''t index any of the information, but it shouldn''t take too long to grep through the ''paths'' files to find which files were made from /etc/passwd or whatever: sudo find $(sudo puppet --configprint bucketdir) -name paths -exec grep ''/my/file'' | xargs ls -t *Something* like that (my shell isn''t exactly top notch these days) should get you a list of the files created from that path, sorted by time. -- The Ninety-Ninety Rule of Project Schedules: The first 90% of the task takes 90% of the time, and the last 10% takes the other 90%. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Here''s a quick one... ---- snip ---- file=$1 BUCKETDIR=$( puppetd --configprint clientbucketdir ) for f in $( find $BUCKETDIR -type f -name paths -exec grep -l $file {} \; |xargs ls -t); do md5sum=$( basename $(dirname $f)) filename=$(< $f ) modify_time=$(stat --format ''%y'' $f) echo -e "$filename\t$md5sum\t$modify_time" done ---- snip ---- On 2/5/08, Luke Kanies <luke@madstop.com> wrote:> > On Feb 5, 2008, at 4:35 PM, John Philips wrote: > > > > Anyway, am I out of luck restoring backups without > > knowing the md5sum of the file I want to retreive? > > Well, Puppet doesn''t index any of the information, but it shouldn''t > take too long to grep through the ''paths'' files to find which files > were made from /etc/passwd or whatever: > > sudo find $(sudo puppet --configprint bucketdir) -name paths -exec > grep ''/my/file'' | xargs ls -t > > *Something* like that (my shell isn''t exactly top notch these days) > should get you a list of the files created from that path, sorted by > time. > > -- > The Ninety-Ninety Rule of Project Schedules: > The first 90% of the task takes 90% of the time, and the last > 10% takes the other 90%. > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >-- stickm@gmail.com -==< Stick >==- _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users