Clarify editing cron job and specify that this represents a minimal effort solution

Jerry Heiselman 2019-01-10 11:13:48 -06:00
parent a8866ed58b
commit 21a13abc2f

@ -60,20 +60,20 @@ MediaServerDownload="https://yourserver.com/matterbridge"
When using the local download configuration, matterbridge does not clean up any of the content it downloads to the Mediaserver path.
## Sidenote
If you run into issues with the amount of storage availble, then it is advised to do an automated cleanup which is to be done externally (i.e. via cron). An example cronjob and script are below:
If you run into issues with the amount of storage availble, then it is advised to do an automated cleanup which is to be done externally (i.e. via cron). An example of a clean up script and two examples of cron jobs are provided below. These represent the minimal amount of effort needed to handle this and don't take into account any ability to customize much.
Adding the cronjob:
Use crontab /etc/crontab to be able to add the following line.
crontab:
```
@daily /path/to/matterbridge/cleanup.sh
```
The cronjob will now run cleanup.sh on a daily interval. The cleanup.sh with the following contents does a very basic clean up.
cleanup.sh:
```
#!/bin/bash
find /path/to/matterbridge -type d -mtime +30 | xargs rm -rf
```
To run the script as the user running matterbridge, execute `crontab -e` and add the following line to the bottom of the file:
```
@daily /path/to/matterbridge/cleanup.sh
```
If you want to run it as root, then it is easiest to add the script to /etc/cron.daily:
`cp /path/to/cleanup.sh /etc/cron.daily`. This will execute it daily automatically in most Redhat and Debian based Linux distros.
This will delete all downloaded content that is more than 30 days old. You should adjust the path and the max age to suit your own needs.