# Back up your important Google Sheets and Docs every night

[Español](https://pushbuild.com/es/free/scripts/nightly-sheet-backup/) · [Português](https://pushbuild.com/pt/free/scripts/nightly-sheet-backup/) · [Deutsch](https://pushbuild.com/de/free/scripts/nightly-sheet-backup/) · [Français](https://pushbuild.com/fr/free/scripts/nightly-sheet-backup/)

**Short answer:** Use a free Google Apps Script that copies the Google Sheets, Docs and folders you list into a dated folder in Google Drive every night, and deletes copies older than the number of days you choose. It runs in your own Google account; nothing is sent to us. Setup takes 5 steps: Make a Backup tab; Choose how long to keep copies; Paste the script; Run a first backup; Turn on nightly backups.

## How to set it up

1. **Make a Backup tab.** Open a Google Sheet and add a tab called Backup. From A2 down, paste the link of each file you want backed up. A folder's link backs up the files directly inside it.
2. **Choose how long to keep copies.** In D1, type how many days of backups to keep, such as 30.
3. **Paste the script.** Open Extensions, then Apps Script, paste in the code from our email, and save. Reload the sheet and a **Backup** menu appears.
4. **Run a first backup.** Choose **Backup**, then **Back up now**, and allow the permissions. A Backups folder appears in your Drive with a folder named with today's date holding the copies.
5. **Turn on nightly backups.** Choose **Start nightly backup**. A backup runs around 2am each night, and dated folders older than your limit go to the Drive trash.

Setup, step by step: 5 steps, done in your own Google account.

[Want this set up for your business? Free written scope in 20 minutes](https://pushbuild.com/scope.html?topic=Set%20up%3A%20Back%20up%20your%20important%20Google%20Sheets%20and%20Docs%20every%20night)

## Get the script

### Download it free

We'll email you the script (`Code.gs`). It runs in your own Google account; nothing is sent to us.

### Have us install it for you

We set it up in your own Google account for you and check that it runs.

[Have us install it](https://pushbuild.com/services/workflow-automation.html?need=snippet-install:nightly-sheet-backup#contact)

## Good to know

- Copies are kept in the same Google Drive, so they protect against mistakes and deleted rows, not against losing the account. For that, also download a copy now and then.
- Google Sheets also keeps version history (File, then Version history), which is good for undoing one change. A dated copy is easier to compare and restore whole.

## Questions

**What does this script do?**

It is a free Google Apps Script that copies the Google Sheets, Docs and folders you list into a dated folder in Google Drive every night, and deletes copies older than the number of days you choose.

**How do I set it up?**

In 5 steps: 1. Make a Backup tab; 2. Choose how long to keep copies; 3. Paste the script; 4. Run a first backup; 5. Turn on nightly backups. The full steps are on this page.

**Is it free, and does it send my data anywhere?**

It is free: enter your email on this page and we email you the script (`Code.gs`). It runs in your own Google account; nothing is sent to us.

**Can you install it for me?**

Yes. We set it up in your own Google account for you and check that it runs.

Want this connected to the rest of your tools? [Send us a short brief](https://pushbuild.com/services/workflow-automation.html#contact).

**Pushbuild** · Automate your business with Pushbuild: [pushbuild.com/contact](https://pushbuild.com/contact)

---
As of 2026-11-23. Source: https://pushbuild.com/free/scripts/nightly-sheet-backup/
