Under Settings → Online Accounts I am able to connect my gmail account, which allows me to mount my google drive as a network drive. The path of the mount was found by opening a terminal within the mount window. It is given by:
/run/user/1000/gvfs/google-drive:host=gmail.com,user=gmail_user_name
I am trying to write a crontab background process which syncs specified folders from my home directory every so often. I do so by using the following bash script to transfer specified directories into the mounted network drive.
Code:
#!/bin/bash
googledrive_dir=/run/user/1000/gvfs/google-drive:host=gmail.com,user=gmail_user_name
dir_cat='Admin'
for name in $dir_cat
do
rsync -avhz ~/$name $googledrive_dir/--delete
done
Upon running the bash script, the files inside the directories within each specified folder in dir_cat are deleted. And I get an output error, shown below:
Code:
sending incremental file list
rsync: failed to set times on "/run/user/1000/gvfs/google-drive:host=gmail.com,user=google_user_name/Admin":Operation not supported (95)
deleting Admin/19sZNc-h9o1u65ZT5ANXyKXgQVEzU92Th
Admin/
Admin/cubicle_name_tag.odt
rsync: mkstemp "/run/user/1000/gvfs/google-drive:host=gmail.com,user=google_user_name/Admin/.cubicle_name_tag.odt.Que9bQ" failed:Operation not supported (95)
sent 11.68K bytes received 377 bytes 3.44K bytes/sec
total size is 13.12K speedup is 1.09
rsync error: some files/attrs were not transferred (see previous errors)(code 23) at main.c(1207)[sender=3.1.3]
I found that by replacing the '-a' with '-r', rsync first deletes all the contents in the specified folders before copying over the files. This process is time consuming and computationally wasteful.
How should I go about this?
Bookmarks