index.1 anymore, which happens here https://git.proxmox.com/?p=pve-mana...4e01931b2f6b9577c49b0514745ba9eb;hb=HEAD#l129I made a script that changes the number of 20,000 entries (around 1 year task history) by cron.Hi, no there is no option to configure this. The size of the archived tasks is hard coded to about 1000 entries, as you can see here https://git.proxmox.com/?p=pve-comm...6f62250b47c7b4aee163d2adeb847685;hb=HEAD#l354
The tasks are cleaned up once they are not referenced byindex.1anymore, which happens here https://git.proxmox.com/?p=pve-mana...4e01931b2f6b9577c49b0514745ba9eb;hb=HEAD#l129
#!/bin/bash
# /etc/cronscripts/change_pve_task_history_size/update_pve_max_task_history_size.sh
# Path to the RESTEnvironment.pm file
FILE="/usr/share/perl5/PVE/RESTEnvironment.pm"
# Search and replacement strings
SEARCH="my \$maxsize = 50000; # about 1000 entries"
REPLACE="my \$maxsize = 1000000; # about 20000 entries, around 1 year task history"
# Check if the file exists
if [[ -f "$FILE" ]]; then
# Check if the target string exists in the file
if grep -qF "$SEARCH" "$FILE"; then
logger -t change_pve_task_history_size "String found in $FILE. Replacing '$SEARCH' with '$REPLACE'."
# Create a backup of the file
BACKUP_FILE="$FILE.$(date +%Y%m%d_%H%M%S)"
cp "$FILE" "$BACKUP_FILE"
logger -t change_pve_task_history_size "Backup created: $BACKUP_FILE"
# Replace the target string in the file
sed -i "s|$SEARCH|$REPLACE|" "$FILE"
logger -t change_pve_task_history_size "String replaced successfully in $FILE."
# Restart Proxmox services
systemctl restart pvedaemon.service pveproxy.service
logger -t change_pve_task_history_size "Services restarted."
else
logger -t change_pve_task_history_size "Search string not found in $FILE. No changes made."
fi
else
logger -t change_pve_task_history_size "File $FILE does not exist!"
fi
# Cron job for updating Proxmox task history size
# /etc/cron.d/change_pve_task_history_size
@reboot root /etc/cronscripts/change_pve_task_history_size/update_pve_max_task_history_size.sh
0 * * * * root /etc/cronscripts/change_pve_task_history_size/update_pve_max_task_history_size.sh
/etc/cronscripts/change_pve_task_history_size/update_pve_max_task_history_size.shjournalctl -t change_pve_task_history_sizeJan 06 12:00:00 hostname change_pve_task_history_size[1234]: String found in /usr/share/perl5/PVE/RESTEnvironment.pm. Replacing 'my $maxsize = 50000; # about 1000 entries' with 'my $maxsize = 1000000; # about 20000 entries, around 1 year task history'.
Jan 06 12:00:00 hostname change_pve_task_history_size[1234]: Backup created: /usr/share/perl5/PVE/RESTEnvironment.pm.20250106_120000
Jan 06 12:00:00 hostname change_pve_task_history_size[1234]: String replaced successfully in /usr/share/perl5/PVE/RESTEnvironment.pm.
Jan 06 12:00:01 hostname change_pve_task_history_size[1234]: Services restarted.
Try it.Hi, is there any way of increasing the length of time that logs are stored in /var/log/pve/tasks? It doesn't look like they are cleanup up by logrotate.
Hi, no there is no option to configure this. The size of the archived tasks is hard coded to about 1000 entries, as you can see here https://git.proxmox.com/?p=pve-comm...6f62250b47c7b4aee163d2adeb847685;hb=HEAD#l354
The tasks are cleaned up once they are not referenced byindex.1anymore, which happens here https://git.proxmox.com/?p=pve-mana...4e01931b2f6b9577c49b0514745ba9eb;hb=HEAD#l129
I just ran into the same thing. PBS does solve this much better with respect to longevity of messages. There is no index, but archive and it has thousands of entries.
It would be really great to have better this. I just opened a bug report for this.
DISCLAIMER OF WARRANTY
The software, scripts, documentation, and any related materials (“Materials”) are provided “AS IS”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the authors, contributors, or Virtnet.bond be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Materials or the use of the Materials.
LIMITATION OF LIABILITY
To the maximum extent permitted by applicable law, Virtnet.bond and its contributors shall not be liable for any direct, indirect, incidental, consequential, special, exemplary, or punitive damages, including loss of data, loss of profits, system failure, or other commercial damages or losses, arising out of or related to your use or inability to use the Materials, even if advised of the possibility of such damages.
INDEMNIFICATION
By using or distributing the Materials, you agree to indemnify, defend, and hold harmless Virtnet.bond, its owners, affiliates, and contributors from and against any and all claims, liabilities, damages, losses, costs, expenses, or demands (including reasonable attorneys’ fees) arising out of or related to:
NO OBLIGATION TO SUPPORT
- Your use, modification, or distribution of the Materials;
- Your violation of any applicable law or regulation; or
- Any claim alleging that your use of the Materials caused damage to any person, entity, or system.
Virtnet.bond and contributors have no obligation to provide maintenance, support, updates, or fixes. Use of the Materials is entirely at your own risk.
To add here a little hint:I'm trying to review the task history for an LXC and the LXC has _ZERO_ task entries for the last year, but I know for a fact there's multiple. Can we _please_ have this number increased by... a lot? Or changed in nature so that task history limits are at least per-object?
We use essential cookies to make this site work, and optional cookies to enhance your experience.