What is file_backup_path?


#1

I noticed the /var/chef/backup folder was getting kinda big. The docs
https://docs.chef.io/config_rb_client.html had this to say about
file_backup_path:

The location in which backup files are stored. If this value is empty,
backup files will be stored in the directory of the target file. Default
value: /var/chef/backup.

What exactly goes in there and why? Do I need to be cleaning it out every
now and then?

Greg


#2

When Chef makes changes to the file system, the files that are changed are
backed up by default. That location is where this backup is stored. They
are there as a fail-safe, in case the changes that were put in place were
made in error. This allows you to recover the previous version of the file.

I’ve not had the backup cache fill up on me before, but you can tune the
number of backups that are kept per resource. I don’t see a way to
configure a backup count globally, but it can be limited on individual
resources using the backup attribute. By default the backup count is set to
5.

File
https://docs.chef.io/resource_file.html#attributes

Remote File
https://docs.chef.io/resource_remote_file.html#attributes

Cookbook File
https://docs.chef.io/resource_cookbook_file.html#attributes

Template
https://docs.chef.io/resource_template.html#attributes

There may be others I’ve missed.

Thanks,

Brandon

On Tue, Apr 28, 2015 at 7:09 PM, Greg Barker fletch@fletchowns.net wrote:

I noticed the /var/chef/backup folder was getting kinda big. The docs
https://docs.chef.io/config_rb_client.html had this to say about
file_backup_path:

The location in which backup files are stored. If this value is empty,
backup files will be stored in the directory of the target file. Default
value: /var/chef/backup.

What exactly goes in there and why? Do I need to be cleaning it out every
now and then?

Greg


#3

Very helpful, thank you!

On Tue, Apr 28, 2015 at 7:57 PM, Brandon Raabe brandocorp@gmail.com wrote:

When Chef makes changes to the file system, the files that are changed are
backed up by default. That location is where this backup is stored. They
are there as a fail-safe, in case the changes that were put in place were
made in error. This allows you to recover the previous version of the file.

I’ve not had the backup cache fill up on me before, but you can tune the
number of backups that are kept per resource. I don’t see a way to
configure a backup count globally, but it can be limited on individual
resources using the backup attribute. By default the backup count is set to
5.

File
https://docs.chef.io/resource_file.html#attributes

Remote File
https://docs.chef.io/resource_remote_file.html#attributes

Cookbook File
https://docs.chef.io/resource_cookbook_file.html#attributes

Template
https://docs.chef.io/resource_template.html#attributes

There may be others I’ve missed.

Thanks,

Brandon

On Tue, Apr 28, 2015 at 7:09 PM, Greg Barker fletch@fletchowns.net
wrote:

I noticed the /var/chef/backup folder was getting kinda big. The docs
https://docs.chef.io/config_rb_client.html had this to say about
file_backup_path:

The location in which backup files are stored. If this value is empty,
backup files will be stored in the directory of the target file. Default
value: /var/chef/backup.

What exactly goes in there and why? Do I need to be cleaning it out every
now and then?

Greg