title: Delete folder by name from google drive using gdrive
body: <p>I have read the documentation for <strong>gdrive</strong> <a href="https://github.com/prasmussen/gdrive" rel="nofollow noreferrer">here</a>, but I couldn't find a way to do what I want to do. I want to write a bash script to upload automatically a specific folder from my hard drive. The problem is that when I upload it several times, instead of replacing the old folder by the new one, it generates a new folder with the same name.</p>
  <p>I could only find the following <strong>partial solutions</strong> to my problem:</p>
  <ul>
  <li>Use update to replace files. The problem with this partial solution is that new files inside the folder could not get uploaded automatically, and I would have to change the bash script every time a new file is produced in the folder that I want to upload.</li>
  <li>Erase the folder by its id from google drive and then upload the folder again. The problem here is that whenever I do this, the id of the uploaded folder chagnes, so I couldn't find a way to write a script to do the work.</li>
  </ul>
  <p>I am looking for any method that solves my problem. But the <strong>precise questions</strong> that could help me are:</p>
  <blockquote>
  <p>Is there a way to delete a folder from google drive (using gdrive) by its name instead of by its id?</p>
  <p>Is there a way to get the id of a folder by its name? I guess not, since there can be several folders with the same name (but different ids) uploaded. Or am I missing something?</p>
  <p>Is there a way to do a recursive update to renew all files that are already inside the folder uploaded on google drive and in addition upload those that are not yet uploaded?</p>
  </blockquote>
  <p>In case it is relevant, I am using Linux Mint 18.1.</p>