GithubHelp home page GithubHelp logo

Comments (8)

ZenithalHourlyRate avatar ZenithalHourlyRate commented on August 14, 2024 1

对于大小信息,可以参考

https://github.com/tuna/tunasync-scripts/blob/48e45fa12ee13a802efee46a810dc8f99f2ed67d/rosdistro.sh#L51

size_pattern = "Total size is ([0-9\\.]+[KMGTP]?)"

tunasync 会在日志中自动查找类似模式并设置大小

您也可以通过 tunasynctl set-size 设置大小

from tunasync.

ZenithalHourlyRate avatar ZenithalHourlyRate commented on August 14, 2024

您可以放置一个 dummy 脚本提供给 tunasync,并将其 interval 设置为较大值。在每次手动更新后手动触发 tunasynctl start -w worker target 即可

from tunasync.

AethoceSora avatar AethoceSora commented on August 14, 2024

十分感谢,这个方案非常实用。

from tunasync.

AethoceSora avatar AethoceSora commented on August 14, 2024

我编写了如下的假脚本,然而worker提示exec format error,无法成功同步。

#set -e
echo "Sync done"
echo "Total size is" $(numfmt --to=iec 1228240142)

请问编写worker可识别的脚本需要遵循什么样的format?

from tunasync.

ZenithalHourlyRate avatar ZenithalHourlyRate commented on August 14, 2024

请问编写worker可识别的脚本需要遵循什么样的format?

您好,您需要在脚本中加入 shebang 以使操作系统认识到如何运行该脚本。您可以编写如下脚本

#!/usr/bin/env bash
#set -e
echo "Sync done"
echo "Total size is" $(numfmt --to=iec 1228240142)

chmod +x 该脚本

from tunasync.

AethoceSora avatar AethoceSora commented on August 14, 2024

仍然出了一些问题...

worker --debug:

[22-11-15 22:38:03][NOTICE][worker.go:191] Received command: restart (rosetta)
[22-11-15 22:38:03][NOTICE][job.go:128] start syncing: rosetta
[22-11-15 22:38:03][DEBUG][job.go:136] hooks: pre-job
[22-11-15 22:38:03][DEBUG][loglimit_hook.go:34] executing log limitter for rosetta
[22-11-15 22:38:03][DEBUG][worker.go:448] reporting on manager url: http://localhost:12345/workers/QLU_Mirrors/jobs/rosetta
[22-11-15 22:38:03][DEBUG][runner.go:90] Executing command /home/qlu_mirrors/scripts/rosetta_fake.sh at /mnt/vos-6izqwyw8/mirrors/rosetta
[22-11-15 22:38:03][DEBUG][runner.go:127] Command start: [/home/qlu_mirrors/scripts/rosetta_fake.sh]
[22-11-15 22:38:03][DEBUG][cmd_provider.go:145] set isRunning to true: rosetta
[22-11-15 22:38:03][DEBUG][base_provider.go:168] calling Wait: rosetta
[22-11-15 22:38:03][DEBUG][job.go:169] provider started
[22-11-15 22:38:03][DEBUG][base_provider.go:165] set isRunning to false: rosetta
[22-11-15 22:38:03][DEBUG][job.go:180] syncing done
[22-11-15 22:38:03][WARNIN][job.go:213] failed syncing rosetta: exit status 127
[22-11-15 22:38:03][DEBUG][job.go:215] post-fail hooks

from tunasync.

ZenithalHourlyRate avatar ZenithalHourlyRate commented on August 14, 2024

failed syncing rosetta: exit status 127

手动执行该脚本结果如何?

在 tunasync 日志目录下(例如 /var/log/tunasync/rosetta )中是否能找到脚本运行的日志?

from tunasync.

AethoceSora avatar AethoceSora commented on August 14, 2024

我愚蠢的CRLF换行引发了这个问题。现在dummy脚本运行良好,worker的执行符合预期。再次感谢!

from tunasync.

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.