Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put a folder tree in cache over sshfs

Tags:

ubuntu

sshfs

I want to work from home via SSH.

I run Ubuntu. I have installed sshfs and mounted my files locally. However, working on local files is too slow, as sshfs fetches files each time it wants to read it.

How can I put everything into cache ?

like image 910
Raphael Jolivet Avatar asked Dec 26 '22 21:12

Raphael Jolivet


2 Answers

Use the cache timeout parameter and set it to a big value (several hours) :

sshfs -C -o cache_timeout=80000 myself@work:~/files_at_work ~/my_home

Then, use this script to fetch all the files and put them into the cache :

#!/bin/bash
for file in `find .`  
do
    echo "$file"
    cat $file > /dev/null
done
like image 86
Raphael Jolivet Avatar answered Dec 29 '22 10:12

Raphael Jolivet


I am working on a generic fuse caching filesystem called catfs which can be used to cache sshfs data. Happy to hear more feedback!

like image 24
khc Avatar answered Dec 29 '22 11:12

khc