且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

自动从 Google Drive 垃圾箱中删除文件

更新时间:2023-12-04 21:02:22

如 [Permanently delete file from google drive ],您可以通过 Appscript 启用 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();
}