I’m looking into the backup strategy, and would love to be able to copy the filesystem and do a mysqldump of the database and then i would setup another server to connect and extract such information through rsync.
I have noticed that there’s a “ghost backup” command, and looks like the right step to do in the machine, previous to copy that .zip file with all the wanted information (filesystem + database copy) using rsync, but this command is interactive.
Is anyway to provide email/password so this “ghost backup” command can be scheduled in the crontab?
You can add ghost backup to the Ghost user’s crontab. Of course, this won’t tell you if it was successful unless you create a script that checks for errors, and writes output to a log or mails the results.
Surely, you have a backup strategy for the server, not only Ghost? That would be a better option.
That’s a viable option for Ghost too. automysqlbackup handles daily, weekly, monthly backups for you, so all you need to do is rsync/var/www (plus /etc/nginx, /etc/letsencrypt, /etc/ssl etc.) and where the database is dumped, e.g., /var/lib/automysqlbackup.
Hi! I am wondering the same thing. I would like to make my ghost backup using the ghost backup -command. The command is interactive (and not suitable for sh scripts), unless --no-prompt flag is used. But then you would need to be able to provide the necessary information via command line flags and I am not able to find any documentation on that.
Although this is an old post, I’ve created a script to backup ghost via crontab or CLI without user input: https://gitlab.com/langlaisg/backup-ghost-cms-script