# Ghost-cli backup command generates error

**URL:** <https://forum.ghost.org/t/ghost-cli-backup-command-generates-error/51432>\
**Category:** Self-hosting\
**Created:** [October 4, 2024, 3:25pm UTC](https://forum.ghost.org/t/ghost-cli-backup-command-generates-error/51432 "2024-10-04T15:25:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Theo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/theo/32/2432_2.png) [@Theo](https://forum.ghost.org/u/Theo)\
**Post date:** [October 4, 2024, 3:25pm UTC](https://forum.ghost.org/t/ghost-cli-backup-command-generates-error/51432/1 "2024-10-04T15:25:05Z")

</div>

* * *

**Issue Summary**  
`ghost backup` command run from ghost-cli fails.

- Explain roughly what’s wrong
- When I run the `ghost backup` command from the ghost-cli, Backing up site fails with message `A ProcessError occurred.`
- What did you expect to happen?
- I expected a successful backup to be generated.

**Steps to Reproduce**

1. Log in to server
2. Switch user to ghost-mgr. `sudo -i -u ghost-mgr`
3. Change directory to ghost. `cd /var/www/ghost`
4. Run `ghost backup` command.

* * *

## Setup information

**Ghost Version**  
_Ghost Version: 5.95.0_  
_Ghost-CLI Version: 1.26.1_

**Node.js Version**  
_v18.20.4_

**How did you install Ghost?**  
_Digital Ocean marketplace - Ghost_

**Provide details of your host & operating system**  
_Ubuntu, v22.04.5 LTS_

**Database type**  
_mysql 8.0.39-0ubuntu0.22.04.1_

**Browser & OS version**  
_Include if reporting frontend bugs._

**Relevant log / error output**

```auto
ghost-mgr@ourtwocentstravel:/var/www/ghost$ ghost backup

Love open source? We’re hiring JavaScript Engineers to work on Ghost full-time.
https://careers.ghost.org

+ sudo systemctl is-active ghost_ourtwocentstravel-com
+ sudo mkdir -p /var/www/ghost/backup
? Enter your Ghost administrator email address ted.leroy@protonmail.com
? Enter your Ghost administrator password [hidden]
+ sudo cp /var/www/ghost/backup/content-from-v5.95.0-on-2024-10-04-14-20-57.json /var/www/ghost/content/data/content-from-v5.95.0-on-2024-10-04-14-20-57.json
+ sudo cp /var/www/ghost/backup/members-from-v5.95.0-on-2024-10-04-14-20-57.csv /var/www/ghost/content/data/members-from-v5.95.0-on-2024-10-04-14-20-57.csv
+ sudo chown -R ghost:ghost /var/www/ghost/content
✖ Backing up site
A ProcessError occurred.

Message: EACCES: permission denied, open '/var/www/ghost/content/data/content-from-v5.95.0-on-2024-10-04-14-20-57.json'
Exit code: EACCES

```

Shouldn’t the chown command be to ghost-mgr:ghost-mgr, not ghost:ghost?

`sudo chown -R ghost:ghost /var/www/ghost/content` should be  
`sudo chown -R ghost-mgr:ghost-mgr /var/www/ghost/content` shouldn’t it?

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [October 4, 2024, 3:48pm UTC](https://forum.ghost.org/t/ghost-cli-backup-command-generates-error/51432/2 "2024-10-04T15:48:16Z")

</div>

> [@Theo](#):
>
> `Message: EACCES: permission denied, ` …

Check your permissions and ownership. The `content` folder is owned by `ghost`.

---

<div class="post-metadata">

**Author:** ![Theo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/theo/32/2432_2.png) [@Theo](https://forum.ghost.org/u/Theo)\
**Post date:** [October 4, 2024, 5:39pm UTC](https://forum.ghost.org/t/ghost-cli-backup-command-generates-error/51432/3 "2024-10-04T17:39:54Z")

</div>

Thank you mjw,

I think the permission denied error is due to the script doing `sudo chown -R ghost:ghost /var/www/ghost/content` instead of `sudo chown -R ghost-mgr:ghost-mgr /var/www/ghost/content`, is it not? This is why I’m submitting as a bug. I’m running the command as `ghost-mgr`, not as `ghost`. I’m wondering if the script hasn’t been updated to reflect use of `ghost-mgr`?

---

<div class="post-metadata">

**Author:** ![Theo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/theo/32/2432_2.png) [@Theo](https://forum.ghost.org/u/Theo)\
**Post date:** [October 4, 2024, 5:44pm UTC](https://forum.ghost.org/t/ghost-cli-backup-command-generates-error/51432/4 "2024-10-04T17:44:48Z")

</div>

Sorry, mjw,

Are you saying the content folder is supposed to be owned by ghost, not ghost-mgr?

Kind regards,

Ted

---

<div class="post-metadata">

**Author:** ![Theo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/theo/32/2432_2.png) [@Theo](https://forum.ghost.org/u/Theo)\
**Post date:** [October 4, 2024, 5:59pm UTC](https://forum.ghost.org/t/ghost-cli-backup-command-generates-error/51432/5 "2024-10-04T17:59:09Z")

</div>

I ran `ghost doctor` and corrected permissions as it recommended, then re-ran `ghost backup` and it ran clean. Thanks mjw!

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [October 4, 2024, 7:35pm UTC](https://forum.ghost.org/t/ghost-cli-backup-command-generates-error/51432/6 "2024-10-04T19:35:16Z")

</div>

Yes, `ghost-mgr` could be any user with permission to install and maintain Ghost. `ghost` owns `content`, and should not be confused with `ghost-mgr`.

---

<div class="post-metadata">

**Author:** ![Theo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/theo/32/2432_2.png) [@Theo](https://forum.ghost.org/u/Theo)\
**Post date:** [October 4, 2024, 7:38pm UTC](https://forum.ghost.org/t/ghost-cli-backup-command-generates-error/51432/7 "2024-10-04T19:38:02Z")

</div>

Thanks so much for your help mjw!

I really try not to post stupid mistakes I make as bugs. Obviously I’m not always successful.

Sorry to have wasted your time on a silly mistake on my end.

Kind regards,

Ted

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [January 2, 2025, 7:38pm UTC](https://forum.ghost.org/t/ghost-cli-backup-command-generates-error/51432/8 "2025-01-02T19:38:36Z")

</div>

Closed on January 2, 2025, 7:38pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
