GithubHelp home page GithubHelp logo

cloud-sync's Introduction

Cloud-Sync

定时同步文件至阿里云盘

环境要求

Python >= 3.8

使用步骤

  1. Clone仓库到本地

    $ git clone https://github.com/klaxonz/cloud-sync.git
    $ pip install -r requirements.txt
  2. 修改配置文件

    配置文件在根目录,文件名称为config.ini

    配置名称 是否必填 描述
    refresh_token 阿里云盘刷新令牌
    encrypt_password 设置了会自动加密上传到阿里云盘,下载时会自动解密,默认不设置
    remote_path 同步至阿里云盘的目录
    local_path 同步至阿里云盘的本地目录
    download_path 从阿里云盘下载文件到本地的目录
  3. 获取refresh_token

    使用者可以用下面的方式获取用户的 refresh_token 值。

    1. 登录 https://www.aliyundrive.com/drive/
    2. 打开浏览器的开发者工具(如 Chrome DevTools)。
    3. 然后选择开发者工具的 Console 面板。输入 JSON.parse(localStorage.token).refresh_token,再回车,获取 refresh_tokenrefresh_token
  4. 执行脚本

    $ cd scripts
    $ sh ./upload.sh
    
  5. 定时任务

    5.1 打开终端并输入以下命令以编辑 cron 作业表

    $ crontab -e
    

    5.2 在编辑器中,添加一个新的 cron 作业

    # 例如,每隔两小时执行一次
    0 */2 * * * /bin/bash /path/to/your/upload.sh
    

版权说明

该项目签署了MIT 授权许可,详情请参阅 LICENSE

鸣谢

AliPCS-Py

cloud-sync's People

Contributors

klaxonz 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.