Answer the question
In order to leave comments, you need to log in
Yandex.Disk (webdav) and linux
Mastering Yandex.Disk in Linux. The use case, as suggested in radio-t: mounted, dropped the backup, unmounted.
As far as I understand davfs uses a cache which adds to ~./davfs2/cache
How can I make davfs synchronize the cache on unmount or not use the cache at all?
Let me explain what the inconvenience is.
I mount the disk, copy a large file (700 MB) there, unmount it.
The file does not appear in Yandex, it remains in the user's cache.
In the output of ps, there is a process that apparently tries to resume the cache of an already unmounted disk, but at what stage this process is not clear.
The default cache size in devfs2.conf is 50mb.
Can I somehow force writing files larger than the cache size immediately to a remote disk?
Answer the question
In order to leave comments, you need to log in
try mounting with the sync
All I/O to the filesystem should be done synchronously option. In case of media with limited number of write cycles (eg some flash drives) "sync" may cause life-cycle shortening.
Well, in general, I made a crutch: before unmounting, we wait until all files leave the cache.
#!/bin/bash
echo "Mount"
mount /mnt/yandex
echo "Copy"
cp ~/yandex_test/* /mnt/yandex
while [ `find ~/.davfs2/cache/ -type f -not -name "index" |wc -l -gt 0 ]; do
sleep 1
done
echo "Umount"
umount /mnt/yandex
At the same time I measured the speed. For two files with a total size of 258MB, the script worked for 7 minutes 12 seconds. Those. speed is about 0.6 megabits. Yandex at my provider is local. Perhaps the "Disk" does not get into the local network while in the "beta" stage.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question