自动从Google云端硬盘垃圾桶中删除文件 [英] Automatically delete file from Google Drive trash

查看:146
本文介绍了自动从Google云端硬盘垃圾桶中删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有几篇文章,但是我无法将代码放在一起以成功运行它。

There are several articles, but I am not able to put a code together to run it successfully.

我看过的一篇文章:从Google驱动器中永久删除文件

我想每小时大约自动删除一次Google云端硬盘回收站文件夹中的项目。每10分钟更喜欢一次。
Google需要实现此有用的功能。

I would like to automatically delete the Google Drive trash folder items every hour or so. Prefer every 10 minutes. Google need to implement this useful feature.

推荐答案

如[从Google驱动器中永久删除文件],您可以启用Drive API,以便通过Appscript访问该方法。查看应用程序配额,以确保您的实现可以支持调用API每十分钟一次。

As stated on [ Permanently delete file from google drive ], you can enable the Drive API in order to get access to the method, through Appscript. Take a look at appscript quotas to ensure that your implementation can support calling the API every ten minutes.

您可以使用以下解决方案:

You can use this solution:

function createTimeDrivenTriggers() {
  ScriptApp.newTrigger('emptyThrash')
      .timeBased()
      .everyHours(1)
      .create();
}

function emptyThrash()
{
  Drive.Files.emptyTrash();
}

这篇关于自动从Google云端硬盘垃圾桶中删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆