i'm using bash script to run mount at startup :
google-drive-ocamlfuse -o allow_other -label storage01 /var/www/web1/media/videos/
google-drive-ocamlfuse -o allow_other -label storage02 /var/www/web2/media/videos/
but occasionally one of the mount crash after 2-3 hours while new video been uploading
i make cronjob to check every 5 minute
*/5 * * * * /usr/local/bin/checkstorage01.sh
*/5 * * * * /usr/local/bin/checkstorage02.sh
but cronjob cant restart my server, the bash script checkstorage01.sh :
if [ ! $(find /var/www/web1/media/videos | wc -l) -gt 1 ]; then
reboot
fi
my question is :
Do you know the easy way to remount automatically if one of the drive crash when mounting?
If the google-drive-ocaml process hangs, you should kill it with -9, then run fusermount -u [mountpoint].
No, what I mean is that you don't need to reboot, you can have a single cron job that runs a script like this:
if [ ! $(find /var/www/web1/media/videos | wc -l) -gt 1 ] || [ ! $(find /var/www/web2/media/videos | wc -l) -gt 1 ]; then
killall -9 google-drive-ocamlfuse
fusermount -u /var/www/web1/media/videos/
fusermount -u /var/www/web2/media/videos/
google-drive-ocamlfuse -o allow_other -label storage01 /var/www/web1/media/videos/
google-drive-ocamlfuse -o allow_other -label storage02 /var/www/web2/media/videos/
fi
wow thank you. i will use it. thank you very much.
Hope that works! Sorry but I didn't tested it. Let me know if it breaks.