Closed Jamesking56 closed 6 years ago
Thank you for your comment. In my environment, I cannot replicate your situation. So can you provide the detail information of your situation? Those are your script and the flow for replicating your situation. By this, the issue might be resolved.
This is my script:
function start() {
// Loop through incoming directories
var incoming = DriveApp.getFoldersByName('_INCOMING').next(),
folders = incoming.getFolders();
while(folders.hasNext()) {
var folder = folders.next();
compileBackup(folder);
incoming.removeFolder(folder);
}
}
function compileBackup(folder) {
var hostname = folder.getName(),
date = new Date(),
newFolder = DriveApp.getFoldersByName(hostname);
if (newFolder.hasNext()) {
newFolder = newFolder.next();
} else {
newFolder = DriveApp.createFolder(hostname);
}
// Create a ZIP of directory
newFolder.createFile(
ZipFolder.zip(folder.getId())
).setName(hostname + '-' + date.getYear() + '-' + date.getMonth + '-' + date.getDay() + '.zip');
}
I have added your library using the key from the README and I am calling the start
function to begin.
Its a backup script that takes a folder full of files, zips and dates them.
When I run your script, no error occurs in my environment. So I couldn't replicate your situation. So although I cannot propose the way for directly resolving your issue, I have 2 questions.
folder.getId()
of ZipFolder.zip(folder.getId())
is an existing folder ID?folder.getId()
when all files are zipped?I think it might be the sheer size of the folder, I think its around 20GB in size
I think that the size cannot be used for zip file. Because the maximum size of a blob for GAS is 50 MB. It seems that this is the specification of GAS. I'm really sorry my library cannot use such large size you want.
No worries, thanks for also providing references :+1:
When I use your library, I get this error: