Last active
September 3, 2019 14:36
-
-
Save qwertme/037923c23e1740ec8f22d3dc61b24873 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'google_drive' | |
while true do | |
begin | |
session = GoogleDrive::Session.from_config("config.json") | |
session.files(q: "trashed = false and (name contains 'unadjustednonraw' or name contains 'facetile' or name contains 'thumb' or name contains 'mini' or name contains 'largepv') and mimeType = 'image/jpeg' and modifiedTime > '2017-08-01T12:00:00'") do |file| | |
puts file.name | |
file.delete | |
end | |
puts 'done' | |
rescue Exception => e | |
puts 'restarting in 1...' | |
puts e.backtrace | |
sleep 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment