mirror of
https://hk.gh-proxy.com/https://github.com/CaptainCore/do.git
synced 2025-10-03 23:34:10 +08:00
👌 IMPROVE: Restic backup
This commit is contained in:
parent
db8027bd0b
commit
66b493ae64
1 changed files with 10 additions and 2 deletions
|
@ -45,7 +45,6 @@ function vault_create() {
|
|||
local sql_file_path="${wp_root_dir}/${db_filename_base}.sql"
|
||||
|
||||
echo " - Generating temporary database dump: $(basename "$sql_file_path")"
|
||||
# Add flags to handle large tables and prevent timeouts, mirroring the db_backup command.
|
||||
if ! "$WP_CLI_CMD" db export "$sql_file_path" --add-drop-table --single-transaction --quick --max_allowed_packet=512M > /dev/null; then
|
||||
echo "❌ Error: Database export failed."
|
||||
rm -f "$sql_file_path"
|
||||
|
@ -63,7 +62,16 @@ function vault_create() {
|
|||
}
|
||||
|
||||
echo " - Backing up current directory (.), which now includes the SQL database dump..."
|
||||
if ! "$RESTIC_CMD" backup --verbose "."; then
|
||||
if ! "$RESTIC_CMD" backup --verbose "." \
|
||||
--exclude '**.DS_Store' \
|
||||
--exclude '*timthumb.txt' \
|
||||
--exclude 'debug.log' \
|
||||
--exclude 'error_log' \
|
||||
--exclude 'phperror_log' \
|
||||
--exclude 'wp-content/updraft' \
|
||||
--exclude 'wp-content/cache' \
|
||||
--exclude 'wp-content/uploads_from_s3' \
|
||||
--exclude 'wp-snapshots'; then
|
||||
echo "❌ Error: Restic backup command failed." >&2
|
||||
rm -f "$sql_file_path"
|
||||
cd "$original_dir"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue