Looking for advice/warnings about doing the following.
I have a read-only file structure accessed through software I can’t easily update. I want to make this software use ipfs. Why?
- All these files are growing too big to fit in one place, so I plan to pin across other nodes, and then allow this one to cache from them as needed.
- I want to push these files into IPFS so I can access from other nodes anyway.
My plan is to add each file to ipfs and then replace it with a symlink to the hash under my /ipfs
mount. The end result will be a directory structure with no actual files, just symlinks.
For each file, it would be something like:
#!/bin/bash
# ipfs-ify.sh
filename=$1
hash=`ipfs add $filename`
rm $filename
ln -s /ipfs/$hash $filename
So I’ll use this + find
to replace a directory recursively:
find /my/old/filestructure/root -type f -exec ipfs-ify.sh {} \;
Will this work? It seems to good to be true…