Skip to content

Instantly share code, notes, and snippets.

@mshock mshock/move_by_size.gs
Last active Aug 29, 2015

Embed
What would you like to do?
backup and delete original files by size in target directory - cleanup reddit wallpaper stash populated by IFTTT
function wallpaper_cleanup() {
var folder = DriveApp.getFoldersByName("wallpapers").next();
var small_folder = DriveApp.getFoldersByName("small_wallpapers").next();
var files = folder.getFiles();
while (files.hasNext()) {
var file = files.next();
if (file.getSize() < 200000) {
file.makeCopy(small_folder);
file.setTrashed(true);
Logger.log(file.getName() + file.getSize());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.