Prechádzať zdrojové kódy

feat: using custom s3sync (#99)

jeessy2 1 rok pred
rodič
commit
c37cebbacb
2 zmenil súbory, kde vykonal 19 pridanie a 11 odobranie
  1. 1 1
      Dockerfile
  2. 18 10
      README.md

+ 1 - 1
Dockerfile

@@ -10,7 +10,7 @@ RUN go env -w GO111MODULE=on \
 FROM golang:1.20 AS s3sync
 
 WORKDIR /src/
-RUN git clone --branch 2.61 https://github.com/larrabee/s3sync.git
+RUN git clone https://github.com/jeessy2/s3sync.git
 
 WORKDIR /src/s3sync
 ENV CGO_ENABLED 0

+ 18 - 10
README.md

@@ -14,8 +14,8 @@
 
 ## docker中使用
 - 运行docker容器(`/opt/backup-x-files`可替换为主机的目录)
-  ```
-  默认启动-rclone的配置会保存到/app/backup-x-files/rclone/rclone.conf:
+  ```shell
+  # 默认启动rclone的配置会保存到/app/backup-x-files/rclone/rclone.conf:
   
   docker run -d --name backup-x --restart=always \
     -p 9977:9977 \
@@ -23,7 +23,7 @@
     jeessy/backup-x
   ```
 - 登录 http://your_docker_ip:9977 并配置
-- docker容器默认安装default-mysql-client/postgres-client/[s3sync](https://github.com/larrabee/s3sync)/rclone/wget/curl
+- docker容器默认安装default-mysql-client/postgres-client/[s3sync](https://github.com/jeessy2/s3sync)/rclone/wget/curl/minio mc
 
 ## 系统中使用
 - 下载并解压[https://github.com/jeessy2/backup-x/releases](https://github.com/jeessy2/backup-x/releases)
@@ -56,15 +56,23 @@
     |  ----  | ----  |
     | 备份单个  | mysqldump -h127.0.0.1 -uroot -p#{PWD} name > #{DATE}.sql |
     | 备份全部  | mysqldump -h127.0.0.1 -uroot -p#{PWD} --all-databases > #{DATE}.sql |
-    | 还原  | mysql -uroot -p123456 name <2021-11-12_10_29.sql |
+    | 还原  | mysql -uroot -p123456 name < 2021-11-12_10_29.sql |
 
  -  文件
-
-    |  说明   | 备份脚本  |
-    |  ----  | ----  |
-    | 备份本地文件到对象存储 [s3sync](https://github.com/larrabee/s3sync) | s3sync --fs-disable-xattr --filter-not-exist --tk #{AccessKey} --ts #{SecretKey} --te #{Endpoint} fs:///opt/test/ s3://#{BucketName}/test/ |
-    | 备份对象存储到对象存储 [s3sync](https://github.com/larrabee/s3sync) | s3sync --filter-not-exist --sk source_key -ss #{PWD} --se https://s3.source.com --tk #{AccessKey} --ts #{SecretKey} --te #{Endpoint} s3://backup/ s3://#{BucketName}/ |
-    | 备份本地文件到对象存储 [rclone](https://rclone.org/) | 参考rclone文档。推荐在系统中使用rclone |
+    - 备份对象存储到对象存储 [s3sync](https://github.com/jeessy2/s3sync)
+    ```shell
+    s3sync --filter-not-exist \
+      --sk source_key -ss #{PWD} --se https://s3.source.com \
+      --tk #{AccessKey} --ts #{SecretKey} --te #{Endpoint} \
+      s3://backup/ s3://#{BucketName}/
+     ```
+
+    - 备份本地文件到对象存储 [s3sync](https://github.com/jeessy2/s3sync)
+    ```shell
+    s3sync --fs-disable-xattr --filter-not-exist \
+      --tk #{AccessKey} --ts #{SecretKey} --te #{Endpoint} \
+      fs:///opt/test/ s3://#{BucketName}/test/
+     ```
 
   - 变量说明