Skip to content

Wordpress-Backuper is a shell script designed to create structured, compressed backups of a WordPress site-specifically focusing on core files, wp-content, and uploads by year.

License

Notifications You must be signed in to change notification settings

BaseMax/wordpress-backuper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ Wordpress Backuper

Wordpress-Backuper is a shell script by Max Base designed to create structured, compressed backups of a WordPress site-specifically focusing on core files, wp-content, and uploads by year.


βœ… Features

  • Zips the root directory (excluding .zip, .gz, .sql, etc.)
  • Separately zips wp-content (excluding uploads)
  • Scans uploads/ for folders like 2020, 2021, etc., and zips each one independently
  • Generates an others.zip for non-year subdirectories in uploads
  • Logs all actions to zip_process.log
  • Supports dry-run and verbose modes
  • Safe: skips zip files that already exist

🧰 Requirements

  • zip
  • find
  • Bash (Linux/macOS)

Install missing dependencies (Debian-based example):

sudo apt install zip findutils

πŸš€ Usage

Quickly

curl -L -o wordpress-backuper.sh https://github.com/BaseMax/wordpress-backuper/raw/refs/heads/main/wordpress-backuper.sh
chmod +x wordpress-backuper.sh
./wordpress-backuper.sh

Clone the repo:

git clone https://github.com/BaseMax/Wordpress-Backuper.git
cd Wordpress-Backuper

Run the script:

./wordpress-backuper.sh

Options

Option Description
-v Verbose mode (print log live)
-n Dry-run (simulate, no zip)
-h Show help

Example:

./wordpress-backuper.sh -v

πŸ“ Output Files

All zip files are saved in the root directory:

  • root.zip β€” All root files except wp-content and known archive formats
  • wp-content.zip β€” All content except uploads/
  • 2020.zip, 2021.zip, ... β€” Individual zip files for each year in uploads
  • others.zip β€” Remaining contents of uploads/ excluding year folders

Log file:

  • zip_process.log β€” Full log of the operation

πŸ§ͺ Example Directory Structure

.
β”œβ”€β”€ index.php
β”œβ”€β”€ wp-content/
β”‚   └── uploads/
β”‚       β”œβ”€β”€ 2021/
β”‚       β”œβ”€β”€ 2022/
β”‚       β”œβ”€β”€ other-dir/

After running the script, you’ll get:

root.zip
wp-content.zip
2021.zip
2022.zip
2....zip
others.zip
zip_process.log

πŸ“¬ Feedback & Contributions

Suggestions, issues, and pull requests are welcome via GitHub Issues.


πŸ™ Credits

  • Developed by Max Base
  • Script licensed under the MIT License

About

Wordpress-Backuper is a shell script designed to create structured, compressed backups of a WordPress site-specifically focusing on core files, wp-content, and uploads by year.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages