Created
July 15, 2023 00:40
-
-
Save ko31/1d1dd6cf6d171500706eddf63ed18934 to your computer and use it in GitHub Desktop.
Shell script to export the backup file using the WP-CLI command of All-in-One WP Migration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/bash | |
# Set backup directory | |
BACKUP_DIR=/path/to/wordpress/wp-content/ai1wm-backups/ | |
# Change directory to the WordPress | |
cd $BACKUP_DIR | |
# Run the wp-cli command to export the backup file | |
wp ai1wm backup | |
# Delete backup files older than seven days | |
find ${BACKUP_DIR}*.wpress -type f -mtime +7 -exec rm {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment