Read a Random Post

Never lose your Gmail Drafts, Auto Save them to Google Drive Periodically

Written by

Topics: Tips & Tricks

how to auto save Gmail Drafts to Google Drive Periodically

Usually when we are about to compose a big email or a mail which requires pending information, we tend to have them in our drafts. We might update them in bits and pieces and send once it’s done. Some of us might even use drafts feature to keep intact crucial and important information and files. Losing them can be unaffordable!

Consider a situation:

You have Gmail account and have composed a lengthy email which contains important data, which you have collected by putting in hours together of research and analysis. Just when you’re about to send the email say you accidentally click on discard draft. Oops! Once in for all your email is gone for ever. You cannot even find them in your trash. This recently happened to me. Hence I have come with a simple backup plan which should be helpful for everyone.

Meet Gmail Drafts Auto Backup script, which will automatically take a backup of your draft emails and attachments and save them onto Google Drive at regular intervals. So you need not worry about your email being lost because there will always be a backup waiting for you at your Google Drive account. Let’s get started on how to set things up.

How to Auto Save your Gmail Drafts to Google Drive

1. Log-in to your Google Drive account.

2. Make a copy of Gmail Drafts Auto Backup script by clicking here. Then click Yes, make a copy.

3. Now select Authorize from Gmail Drafts Auto Backup menu, next to help. Click OK in the popup then click on Grant access followed up by close.

authorize Gmail drafts auto backup script

4. Choose initialize from the menu.

5. Finally choose start Gmail drafts auto backup and wait for a while for the script execution to complete. If everything goes well you will get a success message and initially copy of your drafts and attachments will be saved inside folder named Gmail Draft Backup in Google Drive. Similarly if you want to stop the backup from being created, select stop option from the menu.

Gmail drafts auto backup script success messageGmail Drafts saved to Google Drive as PDF

Now on,the script will be running in background and taking backups every one hour. Existing copies will be removed and replaced with newer ones.

Note: Due to Google resource quota limitations there are chance for the script to fail in-case you have lots of emails in your drafts.

This script is improvisation of Marcello Scacchetti’s original work.

So, did you like the script ? Have you ever found yourself in a bad situation of losing your important drafts ? Have any suggestion or queries ? Feel free to drop in your views.

15 Comments For This Post I'd Love to Hear Yours!

  1. Charles says:

    I Can’t find “Gmail Drafts Auto Backup menu”,tab in docs tabs ..

    3. Now select Authorize from “Gmail Drafts Auto Backup menu”, next to help. Click OK in the popup then click on Grant access followed up by close.

    Please help

    • Charles,

      Wait for a while for the menu to load or manually trigger it by going to Tools-> Script Editor ->Run and click on onOpen. Now you should be seeing the menu in your sheet.

  2. Harish Jindal says:

    Must say, a great utility to save the drafts from getting deleted accidentally.

    BUT, imagine a scenario where the drafts got deleted accidentally and that is the EXACT time of the hour when this script is updating the notes. So, one might still not be able to recover it especially if he delays the process of recovering the deleted draft by few minutes.

    Shouldn’t the utility also have option of back up time? e.g. Back up every 1 hour, Back up every 24 hours etc? This will minimize the probability of event I described above

  3. Harish Jindal says:

    Ok, I wasn’t very clear on my suggestion!

    I know it runs every hour and takes backup. That’s why I wrote that if draft gets deleted and that minute if the script takes backup (which means the deleted draft will not be backed up) then we will not recover that draft.

    What I meant was instead of JUST one option of having backup every one hour (which means that in above scenario, the draft may not be recovered), how about having more options eg back up every 24 hours, back up every 1 week. This might also be better on data usage point of view in case someone has many old drafts with attachments.

    • Ya got you. It’s possible to have those options but requires bit of code change.

      But I see there is no need for that because running every hour increases the case of better backup because if every 24 hours it’s just going to run once in a day but if it’s every 1 hour it’s going to run 24 times in a day(all days in a week too) hence greater the chances.

      Hope you got me..

  4. Harish Jindal says:

    Ok Thanks.

    Query: Does this script run in my gmail id in the background? Means, do I need to have my laptop or device turned on for the script to be taking backup?

  5. mike says:

    Message details
    ReferenceError: “DocsList” is not defined.

  6. Anton says:

    Getting the same error as mike.

  7. TJ says:

    Hi there,

    After running the script, I see quite a few drafts are backed-up, but got this “Exceeded maximum execution time”, It has not backed-up all my drafts.

    Any help in this regards would be appreciated.

    Also does the script read/forward any personal user data from gmail?

Leave a Comment Here's Your Chance to Be Heard!