如何从谷歌硬盘垃圾文件夹中自动删除文件? [英] How to automatically delete file from google drive trash folder?

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

问题描述



这里是我看过的一篇文章:永久删除谷歌驱动器中的文件



我想每隔一小时左右自动删除谷歌垃圾文件夹项目。优选每10分钟一次。谷歌需要实现这个有用的功能。

解决方案

正如在[永久删除文件从谷歌驱动器],您可以启用云端硬盘API,以通过Appscript访问该方法。查看 appscript配额,以确保您的实施可以支持呼叫该API每隔十分钟一次。



您可以使用此解决方案:

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


函数emptyThrash()
{
Drive.Files.emptyTrash();
}


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

here one article I have looked at: Permanently delete file from google drive

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

解决方案

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();
}

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

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