I use Google Drive for work, but there is no native sync client for Linux. Given the stability and awesomeness of rclone, I recently decided to set up my own version.
I do not like working directly on the mount because, even with vfs-cache, programs some time choke opening or saving documents and the Cache frontend caused a hard lock a couple of times. I cannot take chances like that with my work.
I landed on using mergerfs to overlay a local cache on top of an rclone mount and a cron job to sync everything up daily. I really, really do not want it to touch the native Google Docs files, so I mounted it using this command (the product of trial and error):
/usr/local/bin/rclone mount gdrive: /mnt/rclone/gdrive --ask-password=false --allow-other --drive-skip-gdocs --buffer-size 256M --drive-chunk-size 32M --log-level INFO --log-file /var/log/gdrive.log --timeout 1h --umask 002 --vfs-cache-mode=writes
The meaty part of the sync script looks like this:
### Set Rclone defaults
export RCLONE_ASK_PASSWORD=false
export RCLONE_STATS_ONE_LINE=true
export RCLONE_LOG_FILE="${LOGFILE}"
export RCLONE_LOG_LEVEL=NOTICE
export RCLONE_DRIVE_USE_TRASH=true
export RCLONE_DRIVE_SKIP_GDOCS=true
logger "*** Copying ${CACHE} -> ${REMOTE} ***"
${RCLONE} copy "${CACHE}" "${REMOTE}"
logger "*** DONE ***"
logger "*** Copying ${REMOTE} -> ${CACHE} ***"
${RCLONE} copy "${REMOTE}" "${CACHE}" \
--exclude='Backup/**' \
--exclude='Bureaucracy/**'
logger "*** DONE ***"
When I tested it using rclone ls
inside the script, it completely ignored the Google Docs files, as desired, however, after running the script I noticed that all of my (hundreds) of Google Docs/Sheets/Slides files now have .docx, .pptx, .xlxs files along side them.
I cannot be sure if the mount created them or the sync script, because I didn't notice until I went to attach a file to an email.
The expected behavior was that rclone, both in the mount and the sync script, would just ignore the Google Docs native file formats entirely...
Did I do something stupid here? Is there a bug with rclone?