From 5f3c54072b3f07778c4e10360765fc680ab20f58 Mon Sep 17 00:00:00 2001 From: Pieter Claerhout Date: Thu, 11 Jan 2024 07:30:11 +0100 Subject: [PATCH] Made it possible to run the backup, cleanup and monitor commands in isolated mode --- docs/advanced-usage/isolated-mode.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/advanced-usage/isolated-mode.md diff --git a/docs/advanced-usage/isolated-mode.md b/docs/advanced-usage/isolated-mode.md new file mode 100644 index 00000000..c4a82477 --- /dev/null +++ b/docs/advanced-usage/isolated-mode.md @@ -0,0 +1,22 @@ +--- +title: Isolated mode +weight: 5 +--- + +If your application's scheduler is running on multiple servers, you may limit the backup job to only execute on a single server. + +To indicate that the task should run on only one server, you may use the `--isolated` option when running the task on your server: + +```php +php artisan backup:run --isolated +``` + +The first server to obtain the task will secure an atomic lock on the job to prevent other servers from running the same task at the same time. + +> To utilize this feature, your application must be using the `database`, `memcached`, `dynamodb`, or `redis` cache driver as your application's default cache driver. In addition, all servers must be communicating with the same central cache server. + +The following commands support the `--isolated` option: + +- `backup:run` +- `backup:clean` +- `backup:monitor`