Doloops / mcachefs

mcachefs : Simple filesystem-based file cache based on fuse
64 stars 15 forks source link

added pre mount and umount custom command arguments #18

Closed hradec closed 4 years ago

hradec commented 5 years ago

using pre-mount-cmd and pre-umount-cmd, we can make mcachefs mount the source folder automatically when it's mounted, and umount the source folder once mcachefs is umounted.

For example: mcachefs -o pre-mount-cmd='mkdir -p /source_folder ; sshfs :/source_folder /source_folder', pre-umount-cmd='sudo umount /source_folder ; rmdir /source_folder' /source_folder /backed_folder

this enables mcachefs to be used with autofs smoothly.

todo: add post-mount-cmd to execute a cmd right after mcachefs has being mounted. For example, "echo flush_metadata > /backed_fs/.mcachefs/action"