Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/louisbrunner/slack-channel-backup
Backup (and potentially delete) the content of a Slack channel (including files)
https://github.com/louisbrunner/slack-channel-backup
backup channels slack
Last synced: 4 days ago
JSON representation
Backup (and potentially delete) the content of a Slack channel (including files)
- Host: GitHub
- URL: https://github.com/louisbrunner/slack-channel-backup
- Owner: LouisBrunner
- Created: 2019-09-17T17:23:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-26T10:13:34.000Z (over 1 year ago)
- Last Synced: 2024-04-14T06:03:06.983Z (7 months ago)
- Topics: backup, channels, slack
- Language: Python
- Homepage:
- Size: 91.8 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# slack-channel-backup [![Build Status](https://travis-ci.org/LouisBrunner/slack-channel-backup.svg?branch=master)](https://travis-ci.org/LouisBrunner/slack-channel-backup)
This tool allows you to backup (and potentially delete) the content of a Slack channel (including files).
## Usage
You will need to provide your own `SLACK_API_TOKEN` token as a environment variable
```
$ export SLACK_API_TOKEN=xoxp-WHATEVER
$ ./slack-backup.py '#random' --where mybackup
```You will end up with a folder named `mybackup` containing a `conversation.txt` file with all the history and a `files` folder with the uploaded files (which are properly tagged as such in the history).
The tool also allows to control a date range for the backup and to delete the backed up history:
```
$ ./slack-backup.py -h
usage: slack-backup.py [-h] [--where WHERE] [--delete] [--from FROM] [--to TO] channelBackup a slack channel (and potentially delete) the content of a Slack channel (including files)
positional arguments:
channel channel to backup (use # prefix for channels, @ prefix for DMs)optional arguments:
-h, --help show this help message and exit
--where WHERE where to store the backup
--delete delete the backed up messages
--from FROM when to start backing/deleting up
--to TO when to stop backing/deleting up
```## Required permissions
You will need to [create a Slack app](https://api.slack.com/apps) with the following permissions:
- Always: `files:read`, `users:read`
- When using public channels: `channels:history`, `channels:read`
- When using private channels: `groups:history`, `groups:read`
- When using Direct Messages: `im:history`, `im:read`
- When deleting messages: `chat:write:user`, `files:write:user`## Disclaimer
This project is using the old Slack API for channels and direct messages instead of new conversations one (https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api).