docs: basic example for a Recycle Bin function
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
@@ -108,7 +108,7 @@ While the SFTPGo container is in graceful shutdown mode waiting for the last con
|
|||||||
|
|
||||||
If no connections are active or `SFTPGO_GRACE_TIME=0` (default value if unset) the container will shutdown immediately.
|
If no connections are active or `SFTPGO_GRACE_TIME=0` (default value if unset) the container will shutdown immediately.
|
||||||
|
|
||||||
:warning: The default docker grace time is 10 seconds, so if your SFTPGO_GRACE_TIME is larger than the docker grace time, then any `docker stop some-sftpgo` command will terminate your container once the docker grace time has passed. To ensure that the full SFTPGO_GRACE_TIME can be used, you either need to send a SIGINT or SIGTERM signal because only those 2 signals will trigger a graceful SFTPGo shutdown. Those signals can be sent using one of these commands: `docker kill --signal=SIGINT some-sftpgo` or `docker kill --signal=SIGTERM some-sftpgo`.
|
:warning: The default docker grace time is 10 seconds, so if your SFTPGO_GRACE_TIME is larger than the docker grace time, then any `docker stop some-sftpgo` command will terminate your container once the docker grace time has passed. To ensure that the full SFTPGO_GRACE_TIME can be used, you can send a SIGINT or SIGTERM signal. Those signals can be sent using one of these commands: `docker kill --signal=SIGINT some-sftpgo` or `docker kill --signal=SIGTERM some-sftpgo`.
|
||||||
Alternatively you can increase the default docker grace time to a value larger than your SFTPGO_GRACE_TIME. The default docker grace time can either be specified at creation/run time using `--stop-timeout <value>` or you can simply add `--time <value>` to the docker stop command like in this 60 seconds example `docker stop --time 60 some-sftpgo`.
|
Alternatively you can increase the default docker grace time to a value larger than your SFTPGO_GRACE_TIME. The default docker grace time can either be specified at creation/run time using `--stop-timeout <value>` or you can simply add `--time <value>` to the docker stop command like in this 60 seconds example `docker stop --time 60 some-sftpgo`.
|
||||||
|
|
||||||
### Where to Store Data
|
### Where to Store Data
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ Done! Create a new user and check that the defined directories are automatically
|
|||||||
Let's see how you can receive an email notification after each upload and, optionally, the uploaded file as well.
|
Let's see how you can receive an email notification after each upload and, optionally, the uploaded file as well.
|
||||||
|
|
||||||
From the WebAdmin expand the `Event Manager` section, select `Event actions` and add a new action.
|
From the WebAdmin expand the `Event Manager` section, select `Event actions` and add a new action.
|
||||||
Create an action named `upload notification`, with the settings you can see in the following screen.
|
Create an action named `upload notification` with the settings you can see in the following screen.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -94,3 +94,42 @@ You can also filters events based on protocol, user and group name, filepath she
|
|||||||
|
|
||||||
As actions, select `upload notification`.
|
As actions, select `upload notification`.
|
||||||
Done! Try uploading a new file and you will receive the configured email notification.
|
Done! Try uploading a new file and you will receive the configured email notification.
|
||||||
|
|
||||||
|
## Recycle Bin
|
||||||
|
|
||||||
|
Let's see how we can configure a Recycle Bin style function where files are not deleted strait away, but instead moved to a separate folder.
|
||||||
|
|
||||||
|
To easily apply the Recycle Bin to multiple users we will create a virtual folder and a group, this way all users who belong to the group will have a Recycle Bin.
|
||||||
|
|
||||||
|
Create a virtual folder named `recycle` with the settings you can see in the following screen.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Create a group named `recycle` with the settings you can see in the following screen.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Make your users members of the `recycle` group.
|
||||||
|
|
||||||
|
From the WebAdmin expand the `Event Manager` section, select `Event actions` and add a new action.
|
||||||
|
Create an action named `move to recycle` with the settings you can see in the following screen.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Add another action, named `create move folder`, to create the parent directory for the move destination.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Now select `Event rules` and create a rule named `Recycle rule`, select `Filesystem events` as trigger, `pre-delete` as filesystem event and exclude the `/recycle` path.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
As actions, select `create move folder` and `move to recycle` and for both set `Execute sync`.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Done! Try deleting a file, it will be moved to the Recycle Bin.
|
||||||
|
|
||||||
|
You can also add a scheduled event rule to automatically delete files older than a configurable time from the `recycle` folder.
|
||||||
|
|||||||
BIN
docs/howto/img/recycle-folder.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
docs/howto/img/recycle-group.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
docs/howto/img/recycle-move-action.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
docs/howto/img/recycle-move-folder-action.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
docs/howto/img/recycle-rule-actions.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
docs/howto/img/recycle-rule-path.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
docs/howto/img/recycle-rule.png
Normal file
|
After Width: | Height: | Size: 23 KiB |