Skip to content

Commit

Permalink
GH-10: add download log feature
Browse files Browse the repository at this point in the history
  • Loading branch information
rain1024 committed Apr 15, 2019
1 parent de0f349 commit cebc60b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chatbot-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source activate chatbot
alias chatbot="python chatbot.py"
24 changes: 24 additions & 0 deletions chatbot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import click
import subprocess


@click.group()
def main(args=None):
"""Console script for chatbot"""
pass


@main.group()
def log(args=None):
"""Log handling"""
pass

@log.command()
def download(args=None):
"""Download log from server"""
subprocess.call(["rsync", "-Pav", "[email protected]:/root/service/chatbot/logs/*", "logs"])
print("Download log")


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Click==7.0

0 comments on commit cebc60b

Please sign in to comment.