What is the best way to manage the content my node is hosting?
For example, a while ago for fun I pinned Stephen Hawkings thesis paper from 1966 to my node. Let’s say I no longer wish to pin this content, what is the easiest way for me to unpin it without actually knowing the original hash?
ipfs pin ls gives me a long list of hashes, but how do I know which one(s) are associated with what content, in order to unpin it with ipfs pin rm <hash of content to unpin>?
The mutable file system (ipfs files) is probably the best way to keep track of human-readable names and the corresponding hashes. This is also somewhat well-integrated into the web UI.
First, you’re almost certainly looking for only recursive top-level pinned hashes. You can limit the pin listing to those using ipfs pin ls --type=recursive.
To easily spit out the contents when looking for a particular file, you can do this using the following command. If you want you could also pipe this output into grep or dump it into a text file for searching.
ipfs pin ls --type=recursive -q | xargs -L 1 -I % sh -c 'echo; printf "Pinned hash: "; echo %; ipfs ls %'
3 years fast forward: Are there notable improvements, respectively: How do I manage my pins best having a “file-driven”-mentality / approach? I’ll try to explain in the following, but I understand if it is too long of a read.
So I want to distribute my backup via ipfs. I chose IPFS for transport mainly for its distributed nature in a standardized manner. So I can choose some IPFS pinning service to keep my data, but I could also send some CIDs to friends from time to time if I would like them to store that data, too.
Assume I do daily backups to my /backup folder. My plan was to do the following:
ipfs add -rHw /backup
ipfs files cp <current CID of /backup>
This would allow me to have an MFS on the current state of /backup, but also keep the old CIDs of /backup pinned (I keep all versions). I would then from time to time want to cleanup old pins, say I want to keep the last 100 CIDs of /backup pinned (not much changing there, the backup itself is already deduplicated).
Is this something I can do with IPFS? I already struggle getting current CID of /backup? How do I get older CIDs of /backup?