Giter Site home page Giter Site logo

autobackupgit's Introduction

项目备份工具

这是一个使用 Ruby 编写的项目备份工具。它可以将指定的 Git 仓库克隆到本地,并将其压缩为 zip 文件。

文件结构

  • main.rb: 这是主要的脚本文件,包含了备份操作的所有逻辑。
  • .github/workflows/backup.yml: 这是一个 GitHub Actions 工作流文件,它配置了一个定时任务,每天在 UTC 时间 12:00 执行备份操作。

使用方法

  1. main.rb 文件中,将 repo_urls 数组修改为你想要备份的 Git 仓库的 URL。
  2. 运行 main.rb 脚本,它会将每个仓库克隆到 backup 目录,并将其压缩为 zip 文件。

GitHub Actions 自动备份

Note

为了减少无用的备份,目前会检查备份分支上的最新提交时间,如果最后一次 commit 之后有备份,就取消这次备份,不会再次备份。

你可以使用 GitHub Actions 来自动执行备份操作。只需将此仓库推送到你的 GitHub 账户,然后在 Settings -> Secrets 中添加你的 Git 仓库 URL。然后,GitHub Actions 就会每天在 UTC 时间 12:00 执行备份操作,并将备份文件推送到 backup 分支。

注意:在 backup.yml 文件中,你可能需要修改 branch 参数,以匹配你的备份分支名称。

开发模式

main.rb 文件中,你可以设置 dev_modetrue,这样脚本在执行 git clone 命令时,只会打印命令,而不会真正执行。这对于测试和调试非常有用。

MD5 Directory Name

MD5 ("91QiuChen") = 918d241a56d699f6a260b4fb16e482cb
MD5 ("yuzu") = 72a5383b2a8ed85ec924391519f3f157
MD5 ("suyu") = 4d0902b58cb9e19563e43e9c1e5b8a1f

autobackupgit's People

Contributors

wibus-wee avatar

Stargazers

Leo Wu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.