However, mysqldump doesn’t really do incremental backups – and the “wp-posts” table of my database is nearly 7Gb.
I’m wondering if anybody can point me in the direction of shell scripts, or linux apps, for managing – and maybe even automating – backups. If incremental backups can be done as well, that would be a great bonus.
I suppose I could always write a few cron scripts…
Thanks,
-A
*Makes note to check backup this weekend*
As you’ve stated, mysql doesn’t have the concept of incremental backups (or at least, that’s a nut I’ve never cracked myself). If you’re comfortable with cron jobs then give WP-CLI a look.
You should do the mysql backup as that and file backups are almost 100% bulletproof but give these commands a read.
https://wp-cli.org/commands/db/
https://wp-cli.org/commands/export/
https://wp-cli.org/commands/import/
For CLI and server buffs, wp-cli is a godsend. I don’t think you’ll ever get incremental working for the DB but incremental file backups using tar is pretty straight forward.
https://www.gnu.org/software/tar/manual/html_node/Incremental-Dumps.html
If you store backups in a directory then it’s just a find
command to process files older than a certain days back.
https://www.howtogeek.com/howto/ubuntu/delete-files-older-than-x-days-on-linux/
In that post it’s talking about deleting old files but you can change the -exec rm {}
to a script too so it’s -exec /use/local/bin/script.sh {}
instead.
Jan mentioned it already and covered other points as well. So, let me go off-topic. ??
Xtrabackup utility can be used to take incremental backups. Know more at https://www.percona.com/doc/percona-xtrabackup/2.3/backup_scenarios/incremental_backup.html
Warning: Untested.
If you aren’t already doing the following, I’d strongly recommend…
– To use InnoDB (to stop locking the whole table while doing backup)
– To take backup of individual tables. One at a time. wp-cli comes in handy here.