Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ghost backup support --admin-email, --admin-password arguments #1932

Open
nilsnh opened this issue Feb 27, 2025 · 2 comments
Open

Make ghost backup support --admin-email, --admin-password arguments #1932

nilsnh opened this issue Feb 27, 2025 · 2 comments

Comments

@nilsnh
Copy link

nilsnh commented Feb 27, 2025

Hi! 👋

I would like to do automated backups using ghost backup on my server. However, it prompts for administrator email and password. Link to relevant source file.

Ideally, I should be able to supply the required CLI arguments for admin email and admin password, so that ghost backup can run unsupervised.

@nilsnh
Copy link
Author

nilsnh commented Feb 27, 2025

I can try and make a PR for this feature, if that sounds ok. 😸

@nilsnh
Copy link
Author

nilsnh commented Feb 27, 2025

For now I solved this by using the expect command to handle the interactive prompts.

Sample expect script script.exp:

#!/usr/bin/expect -f

set timeout -1
spawn ghost backup --no-color --dir $::env(DIR)

expect "Enter your Ghost administrator email address"
send -- "$::env(EMAIL)\n"

expect "Enter your Ghost administrator password"
send -- "$::env(EMAIL_PW)\n"

expect eof

Use chmod +x script.exp to make the script executable.

Call the script with DIR=/your-ghost-installation EMAIL=admin@mail EMAIL_PW=somepassword ./script.exp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant