Package: apt-mirror2
Version: 13-2
Severity: minor
X-Debbugs-Cc: atzlinux@debian.org
Hi,
When I enable apt-mirror2 cron in /etc/cron.d/apt-mirror2,
I can't get any log about apt-mirror2 execute in $base_path/var.
The /etc/cron.d/apt-mirror2 use > /dev/null to diable the log output.
This is not a good idear. The log should keep.
I had try to delete "> /dev/null" in /etc/cron.d/apt-mirror2,
I can get the log in logfile under $base_path/var, but the logfile
can't appended.
I suggest support append log.
Thanks!
xiao sheng wen
-- System Information:
Release: 12.11.0
Codename: bookworm
Architecture: x86_64
Kernel: Linux 6.12.22+bpo-rt-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=UTF-8), LANGUAGE=zh_CN:zh
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages apt-mirror2 depends on:
ii adduser 3.134
ii python3 3.11.2-1+b1
ii python3-apt-mirror2 13-1.1~bpo12+1
apt-mirror2 recommends no packages.
apt-mirror2 suggests no packages.
-- no debconf information
Hi!
04.06.2025 07:23, xiao sheng wen пишет:
Package: apt-mirror2
Version: 13-2
Severity: minor
X-Debbugs-Cc: atzlinux@debian.org
Hi,
When I enable apt-mirror2 cron in /etc/cron.d/apt-mirror2,
I can't get any log about apt-mirror2 execute in $base_path/var.
I just checked fresh apt-mirror2 install and can not reproduce this issue.
Are there any files under `$base_path/var`? It should contains `apt-mirror2.log` and one log file per mirror URL.
Yes.
The /etc/cron.d/apt-mirror2 use > /dev/null to disable the log output.
This is not a good idear. The log should keep.
I had try to delete "> /dev/null" in /etc/cron.d/apt-mirror2,
I can get the log in logfile under $base_path/var, but the logfile
can't appended.
The output of command is silenced because apt-mirror2 write log files
in addition to stdout.
Yes, rewrite log is the question.
I suggest support append log.
As of now apt-mirror2 mirrors apt-mirror behavior which rewrite log file every run.
I think it can be made configurable though.
Hi,
在 2025/6/4 21:16, Yuri Konotopov 写道:
Hi!
04.06.2025 07:23, xiao sheng wen пишет:
Package: apt-mirror2
Version: 13-2
Severity: minor
X-Debbugs-Cc: atzlinux@debian.org
Hi,
When I enable apt-mirror2 cron in /etc/cron.d/apt-mirror2,
I can't get any log about apt-mirror2 execute in $base_path/var.
I just checked fresh apt-mirror2 install and can not reproduce this issue. >>
Are there any files under `$base_path/var`? It should contains `apt-mirror2.log` and one log file per mirror URL.
Yes, there two log files under under `$base_path/var`.
I use root's crontab do a test again:
crontab -l -u root
*/2 * * * * /usr/bin/apt-mirror2 > /dev/null
The log output is exist. The "> /dev/null" don't affect whether generate log files.
Yes.
The /etc/cron.d/apt-mirror2 use > /dev/null to disable the log output.
This is not a good idear. The log should keep.
I had try to delete "> /dev/null" in /etc/cron.d/apt-mirror2,
I can get the log in logfile under $base_path/var, but the logfile
can't appended.
The output of command is silenced because apt-mirror2 write log files
in addition to stdout.
Yes, rewrite log is the question.
I suggest support append log.
As of now apt-mirror2 mirrors apt-mirror behavior which rewrite log file
every run.
I think it can be made configurable though.
I suggest set append log as default configuration.
Thanks!
Here is the upstream patch: https://gitlab.com/apt-mirror2/apt-mirror2/-/merge_requests/201
It adds a new `append_logs` setting to mirror.list, with the default value set to `off`. I don't think we should change the default behavior for all users.
For example, in my case, log truncation is the expected behavior — I don't want my logs to grow too large.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 493 |
Nodes: | 16 (2 / 14) |
Uptime: | 178:41:34 |
Calls: | 9,705 |
Calls today: | 5 |
Files: | 13,736 |
Messages: | 6,179,156 |