An open API service indexing awesome lists of open source software.

https://github.com/basemax/wordpress-backuper

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.
https://github.com/basemax/wordpress-backuper

backup backup-wordpress backup-wp bash sh tar targz wordpress wordpress-backup wp zip

Last synced: 2 months ago
JSON representation

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.

Awesome Lists containing this project

README

          

# ๐Ÿ“ฆ Wordpress Backuper

**Wordpress-Backuper** is a shell script by [Max Base](https://github.com/BaseMax) 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):

```bash
sudo apt install zip findutils
````

---

## ๐Ÿš€ Usage

### Quickly

```bash
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:

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

### Run the script:

```bash
./wordpress-backuper.sh
```

### Options

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

### Example:

```bash
./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](https://github.com/BaseMax/Wordpress-Backuper/issues).

---

## ๐Ÿ™ Credits

* Developed by [Max Base](https://github.com/BaseMax)
* Script licensed under the MIT License