直接使用docker 发布
################ when file created transfer it to S3 and delete it #########################3 sudo docker run -itd --privileged --restart=always --name file_transfer_s3 \ -e 'LISTENER_DIR=/opt/listener/' \ -e 'LISTENER_FILE_SUFFIX=mp4,txt,pdf' \ -e 'HISTORY_DATABASE_PATH=/opt/db/dms_file_record.db' \ -e 'DEL_OR_MARK_FILE_DONE=del' \ -e 'LISTENER_DIR_EVENT=created' \ -e 'S3_BUCKET=sea' \ -e 'S3_ACCESS_KEY=paZRwWpsuM3vkUuw' \ -e 'S3_SECRET_KEY=WzLqVt5g9mtM33cQJyQApLOUivXahYeL' \ -e 'S3_ENDPOINT_URL=http://192.168.18.199:9001' \ -v /home/sea/Desktop/dms/d/:/opt/listener/ \ -v /opt/docker/file_transfer_log/:/tmp/ \ happysea/file_transfer_s3 ################ when file rename or moved transfer it to S3 and mark it with .completed #########################3 sudo docker run -itd --privileged --restart=always --name file_transfer_s3 \ -e 'LISTENER_DIR=/opt/listener/' \ -e 'LISTENER_FILE_SUFFIX=mp4,txt,pdf' \ -e 'HISTORY_DATABASE_PATH=/opt/db/dms_file_record.db' \ -e 'DEL_OR_MARK_FILE_DONE=mark' \ -e 'LISTENER_DIR_EVENT=rename' \ -e 'S3_BUCKET=my-bucket' \ -e 'S3_ACCESS_KEY=paZRwWpsuM3vkUuw' \ -e 'S3_SECRET_KEY=WzLqVt5g9mtM33cQJyQApLOUivXahYeL' \ -e 'S3_ENDPOINT_URL=http://192.168.18.199:9001' \ -v /home/sea/Desktop/dms/d/:/opt/listener/ \ happysea/file_transfer_s3:latest
参数说明:
-e 'LISTENER_DIR=/opt/listener/' \ 监听的文件夹
-e 'LISTENER_FILE_SUFFIX=mp4,txt,pdf' \ 需要处理的文件后缀
-e 'HISTORY_DATABASE_PATH=/opt/db/dms_file_record.db' \ 记录文件操作的db文件
-e 'DEL_OR_MARK_FILE_DONE=del' \ 操作完 怎么操作 del : 直接删除 mark : 添加.complated 标记
-e 'LISTENER_DIR_EVENT=created' \ 监听模式 : created or rename 文件创建 或者 重命名
-e 'S3_BUCKET=sea' \
-e 'S3_ACCESS_KEY=paZRwWpsuM3vkUuw' \
-e 'S3_SECRET_KEY=WzLqVt5g9mtM33cQJyQApLOUivXahYeL' \
-e 'S3_ENDPOINT_URL=http://192.168.18.199:9001' \
-v /home/sea/Desktop/dms/d/:/opt/listener/ \ 监听的文件夹
-v /opt/docker/file_transfer_log/:/tmp/ \ 指定日志位置