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

https://github.com/antoonline/bash-script-wordpress-docker-run-cron

This script locates running WordPress instances in Docker containers and triggers the execution of their cron jobs. It iterates through each WordPress instance, changes to the WordPress root directory inside the container, and runs the `wp-cron.php` script as the `www-data` user.
https://github.com/antoonline/bash-script-wordpress-docker-run-cron

cron docker ubuntu wordpress

Last synced: 3 months ago
JSON representation

This script locates running WordPress instances in Docker containers and triggers the execution of their cron jobs. It iterates through each WordPress instance, changes to the WordPress root directory inside the container, and runs the `wp-cron.php` script as the `www-data` user.

Awesome Lists containing this project

README

        

# WordPress Cron Runner

This script is designed to run the WordPress cron (`wp-cron.php`) for all running Docker containers with a WordPress instance.

## Requirements

- Docker
- Bash

## Usage

1. Make sure the `wordpress-docker-run-cron.sh` script is executable:

```
chmod +x wordpress-docker-run-cron.sh
```

2. Run the script:

```
./wordpress-docker-run-cron.sh
```

The script will identify all running Docker containers with a WordPress instance, and then execute the `wp-cron.php` file for each of them.

## How it works

The script performs the following steps:

1. Retrieves the container names of all running WordPress instances.
2. Iterates through the container names and runs the `wp-cron.php` file for each instance.

The script will output the container names of the running WordPress instances and display a message indicating that the cron has been run for each instance. After completing the process for all instances, the script will display a message indicating that all WordPress instances have run the cron.

## License

This project is licensed under the MIT License.

## Want to connect?

Feel free to contact me on [Twitter](https://twitter.com/OnlineAnto), [DEV Community](https://dev.to/antoonline/) or [LinkedIn](https://www.linkedin.com/in/anto-online) if you have any questions or suggestions.

Or just visit my [website](https://anto.online) to see what I do.