# Backing up scripts

![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/939e8c42-427b-43f7-97cc-503067709ab7/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T140000Z&X-Amz-Expires=86400&X-Amz-Signature=3c9445afe999cd27569eaefefe17988b9ceb57e2dd59dec506793fc60a22c69c&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject " =1612x469")SmartBots Playground can keep a copy of the scripts you create in a private GitHub repository. Once it's set up, backups are automatic: you don't need to do anything when you save a script.

Backups are one-way. Playground copies your scripts to GitHub, but changes made on GitHub are not copied back to Playground.

## What you need

* A GitHub account. You can create one for free at [github.com](http://github.com).
* At least one script you created yourself. Scripts bought from the Bot Store are not backed up.
* Playground in **dev** mode. Use the **user / dev** switch at the top of the page.

## Set up backups


1. Open your Playground dashboard and find the **Script backups** card.
2. Click **Set up**.
3. Choose where your scripts go:
   * **New private repository**: Playground creates the repository on your GitHub account.
   * **Existing repository**: use a repository you already have. It must be private.
4. Click **Connect GitHub**. A GitHub window opens.
5. In the GitHub window, authorize **SmartBots Playground**. If GitHub asks, install the SmartBots Playground app and choose which repositories it can access. If you choose **Only select repositories**, include the repository you want to back up to.
6. The GitHub window closes and you return to Playground automatically.

Your first backup starts straight away and shows its progress.

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/4cc7ce96-39ff-4741-bdaa-11f36be189ca/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T140000Z&X-Amz-Expires=86400&X-Amz-Signature=d7d5a42ddcc50612dcc586d374fcef825bb54f2f240ff6f7f14cf111d8030c0d&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =362x393")

## When backups happen

Playground backs up your scripts **5 minutes after your last change**. These all count as changes:

* saving a script
* renaming a script
* moving a script to another folder
* creating or deleting a script

Each change restarts the 5-minute wait. If you save several times in a row, you get one backup containing all your changes, 5 minutes after the last save. If you keep working without a 5-minute break, Playground still backs up at least once an hour.

## What's in your repository

Each script is saved as a JavaScript file in the `scripts` folder. Scripts in a Playground folder go in a subfolder with the same name:

* `scripts/Greeter [aY7kP2mQwX4rT9bLc].js`
* `scripts/Tools/Door opener [CbE5yKXQernrg8W8k].js`

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/73499751-5bc8-443e-b2de-f3886d021787/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T140000Z&X-Amz-Expires=86400&X-Amz-Signature=b8f79ab390e5e60464ba07c329d889822ad57284335c264bdce0c3988d0b4d7f&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =743x813")