Git Product home page Git Product logo

Comments (5)

aspirin-Tony avatar aspirin-Tony commented on July 26, 2024

*/1 * * * * /home/m/bypy.py syncup > /home/bypylog

from bypy.

houtianze avatar houtianze commented on July 26, 2024

你好。
没玩过cron,不过从你的日志来看,删除了云端的文件然后就没有了。猜测:

  • 误跑了bypy.py delete命令
  • syncup 加了三个参数,并且最后的一个参数(deleteremotefile)不为零,并且要同步的远程目录比本地目录要多一些文件。

如果不是上述两个原因,你加上 -d -v 跑一下再贴个输出?

from bypy.

aspirin-Tony avatar aspirin-Tony commented on July 26, 2024

哈哈,搞定了 ,./bypy.py syncup 后面没有跟本地路径,所以导致cron执行的时候只是上传/root中的文件。
./bypy.py syuncup [localdir] 就行了。

还有请问一下syncup和upload的区别是保持本地和远程文件同步吗?本地目录和远程目录实时互相克隆?

from bypy.

aspirin-Tony avatar aspirin-Tony commented on July 26, 2024

cron中bypy.py必须要指定本地路径,与直接shell下不同,shell下不用指定目录,默认上传当前目录。

from bypy.

houtianze avatar houtianze commented on July 26, 2024

哦,默认用当前目录,cron跑的时候的当前目录应该设成了/root。

syncup和upload的区别是:

  • syncup先汇总本地和远端口目录下的文件,比较后上传远程不存在的文件。upload则是一边遍历本地目录,一边上传,不管远端文件存在与否。
  • syncup可以通过指明删除远端文件参数实现向上同步-操作完成后,远端目录变得和本地目录一致。而upload不能做删除。
  • upload可以上传单个文件,syncup只能上传目录。

from bypy.

Related Issues (20)

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.