Automatically mirroring local directories

One of the strong points of IPFS is convenience: The ease with which an user is able to upload files into the network straight from their browser, with no need to setup a web server or find a file host or go through complex menus to publish and update content. I believe the system could be made even more convenient and flexible, using a simple idea I’ve thought about recently.

Currently you put files into IPFS by using the “ipfs add” command, be it through a console or interface. I was wondering whether it will be possible to teach IPFS how to automatically mirror directories on your hard drive into your local IPFS node. What that means is that IPFS would monitor directories you give to it for changes, and automatically make modifications in the following way:

  • If a file is added to the directory, it’s uploaded to IPFS if it doesn’t exist and pinned.
  • If a file is removed from the directory, it’s removed from the local IPFS cache and unpinned.
  • If a file is edited and re-saved, the old file is removed from the local IPFS cache and unpinned, then the new version is uploaded to IPFS and pinned.

As a bonus, IPFS may be able to transmit files directly from their location on your drive, rather than caching them into the user’s IPFS folder. This would prevent data duplication and conserve drive space.

Is this ability currently implemented? If not is it planned at any stage? Do you think it would be useful?

1 Like

There is an issue for a similar sounding feature: https://github.com/ipfs/go-ipfs/issues/4614

I should follow that, thanks for the info! Someone also mentioned an upcoming feature called filestore, which will remove duplication by allowing users to seed files directly from their original locations on the hard drive, removing the need for separate caching.

  • Have you solved the problem yet? i have same usecase .would you give me some suggest?thanks!

Functionality described here is party covered by fuse-mounting the /ipfs folder (ipfs mount) ?