Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This script will replace all soft linked Bosh blobs contained in $BOSH_RELEASE_DIR/blobs with hard links. This helps solve the issue of moving blobs from a created release to a new blobstore. After this script has run `bosh blobs` should show a set of blobs ready to be uploaded to a blobstore. Note: config/blobs will probably need removed.
require 'fileutils'
require 'find'
def cp_symlink(f)
new_file = "#{f}.new"
old_file = File.readlink(f)
FileUtils.cp(old_file, new_file)
`rm -r #{f}`
File.rename(new_file, f)
puts "Processed #{f}"
end
Find.find('blobs') { |e| cp_symlink(e) if File.symlink?(e) }
p "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.