如何同步到 Google Drive 中的特定文件夹

如何同步到 Google Drive 中的特定文件夹

我正在使用 Ubuntu 16.04。我尝试使用 grive2 同步我的 Google Drive,这样只有特定文件夹才会被视为 Google Drive 中的根文件夹,即只有指定 Google Drive 文件夹中包含的文件和文件夹才会同步。

我知道 -p 参数,但出于某种原因,我无法输入正确的路径。请有人帮忙。

我已尝试以下命令。

grive -p ./my_directory -a  

grive -p ./"my_directory" -a  

grive -p "Id" -a #where ID is the id of the resource as per Google Drive API

每个都会引发相同的错误。

exception: /build/grive2-2Hxkkx/grive2-0.5.1/libgrive/src/util/File.cc(128): Throw in function void gr::File::Open(const boost::filesystem::path&, int, int)
Dynamic exception type: boost::exception_detail::clone_impl<gr::File::Error>
[gr::expt::BacktraceTag*] = #0 0x578d79 grive gr::Exception::Exception()
#1 0x580917 grive gr::File::Error::Error()
#2 0x57fd69 grive gr::File::Open(boost::filesystem::path const&, int, int)
#3 0x57fe82 grive gr::File::OpenForWrite(boost::filesystem::path const&, int)
#4 0x57fb89 grive gr::File::File(boost::filesystem::path const&, int)
#5 0x57f2cc grive gr::Config::Save()
#6 0x50b63d grive Main(int, char**)
#7 0x50c1e9 grive main
#8 0x7f885cad9830 /lib/x86_64-linux-gnu/libc.so.6 __libc_start_main
#9 0x50a4b9 grive _start

2, "No such file or directory"[boost::errinfo_file_name_*] = ./my_directory/.grive
[boost::errinfo_api_function_*] = open

我不知道如何指定路径参数。

答案1

我对你所说的“只有特定文件夹才会被视为 Google Drive 中的根文件夹,即只有指定 Google Drive 文件夹中包含的文件和文件夹才会同步”的意思有点困惑。

你想要:

a)my_directory = 你的 Google Drive 根目录,正如我读到的句子的第一部分,或者

b)my_directory = google drive 中名为 my_directory 的文件夹,我如何阅读第二部分。

这就是我实现 b) 的方法(在我的例子中,my_directory 位于 ~/grive):

cd $HOME/grive
grive -s my_directory

顺便说一下,我第一次只需要使用 -a。

相关内容