Created
February 12, 2026 18:34
-
-
Save juanboterotech/76409519a4f5af3164051d50ab301d88 to your computer and use it in GitHub Desktop.
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
| #!/bin/bash | |
| # Define WordPress folder, customizeit to your path | |
| wordpress_folder="/home/username/www/wordpress" | |
| backup_folder="/home/username/backup_folder" | |
| current_date=$(date +"%d-%m-%Y") | |
| # Create tar.gz from wordpress folder and save it to the desired folder | |
| # Customize path to your PRIVATE backup folder | |
| cd "$backup_folder" || { echo "Error: backup_folder does not exist"; exit 1; } | |
| tar -czvf "wordpress-${current_date}.tar.gz" "$wordpress_folder" | |
| echo "Backup task done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment