我使用rclone
Ubuntu 12.04将文件从服务器上传到Google云端硬盘。一切正常,但我不知道用什么命令可以删除目录中的所有文件。我有一个叫的遥控器gdrive
。
我尝试使用空路径:
root@machine:~$ rclone purge gdrive:
2015/09/13 00:54:02 Attempt 1/3 failed with 1 errors and: Can't purge root directory
2015/09/13 00:54:02 Attempt 2/3 failed with 1 errors and: Can't purge root directory
2015/09/13 00:54:02 Attempt 3/3 failed with 1 errors and: Can't purge root directory
2015/09/13 00:54:02 Failed to purge: Can't purge root directory
我尝试使用*
:
root@machine:~$ rclone purge gdrive:*
2015/09/13 00:56:49 Attempt 1/3 failed with 1 errors and: Couldn't find directory: "*"
2015/09/13 00:56:49 Attempt 2/3 failed with 1 errors and: Couldn't find directory: "*"
2015/09/13 00:56:49 Attempt 3/3 failed with 1 errors and: Couldn't find directory: "*"
2015/09/13 00:56:49 Failed to purge: Couldn't find directory: "*"
使用清除来删除目录和文件,我知道工作原理很好,但是我无法猜测如何一次删除根目录中的所有文件,并且rclone命令的文档很差。
在寻找有关rclone的更多信息时,我偶然发现了您的问题。我想到的是与一个空目录同步,如:
rclone sync / path / to / a / empty / folder gdrive:
从理论上讲,它可以工作,以http://rclone.org/docs/上的文字为前提:“将源同步到目标,仅更改目标...目标已更新以匹配源,包括在必要时删除文件。” 这只是一个变通办法,我还没有测试过,只是觉得应该提一下。祝你好运 :)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句