mirror of
https://github.com/seigler/slack-cleanup
synced 2025-07-27 01:36:12 +00:00
28 lines
997 B
Markdown
28 lines
997 B
Markdown
# Slack Cleanup
|
|
|
|
[](https://circleci.com/gh/madecomfy/slack-cleanup/tree/master)
|
|
|
|
A small Go program for cleaning up slack file uploads. Useful if you keep hitting limits on your team plan as there is no way to bulk delete files.
|
|
|
|
## Installing Slack Cleanup
|
|
|
|
go get -u github.com/madecomfy/slack-cleanup
|
|
|
|
You will need to generate an API token that has permission to delete files. Add this token to your environment
|
|
variables. At MadeComfy we use [Direnv](https://direnv.net/) to manage local environment variables.
|
|
|
|
export SLACK_API_TOKEN=xoxp-111111-1111111-1111111-1111111-111111
|
|
|
|
## Running Slack Cleanup
|
|
|
|
We assume your $GOPATH/bin folder is in your PATH.
|
|
|
|
$ slack-cleanup
|
|
|
|
Slack cleanup will delete any files older than the past 2 weeks.
|
|
|
|
## Future Improvements
|
|
|
|
- S3 backups of old files
|
|
- Configurable time periods
|
|
- Lamba installation
|