go-pusher

command module
v0.0.0-...-ae3a0e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 4 Imported by: 0

README

go-pusher

English | 简体中文

go-pusher is a tool that can help you upload files to oss and backup file to vps regularly.

Requirements

  • Go 1.20 and above.

Features

  • upload file to OSS if the file does not exist in OSS or the file in OSS is different from the local file
  • backup local file to VPS regularly

Usage

  • build bin

    go build main.go

  • add execute permission

    chmod +x ./main

  • run with config

    ./main -configPath "Your config file abstract path"

Config file

Config file is like following:

modes = ["pusher", "syncer"]

[syncer]
# local directory abstract path
local-path = "xxx"
# remote directory abstract path
remote-path = "xxx"
# time to check file change(second)
interval = 1

[pusher]
# oss provider( now support: qiniu)
oss-provider = "qiniu"
oss-object-prefix = "blog/public"
push-timeout = 60
local-directory = "/path/to/push"
oss-delete-not-exists = false

[oss-qiniu]
bucket = "xxx"
region = "ZoneHuadong"
access-key = "xxx"
sercet-key = "xxx"

why cretea go-pusher

LICENSE

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
component
oss

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL