Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Automatically remove the update package in the /opt/1panel/tmp/upgrade directory #7361

Open
Cusanity opened this issue Dec 13, 2024 · 3 comments
Assignees

Comments

@Cusanity
Copy link

1Panel Version

v1.10.22-beta.2

Please describe your needs or suggestions for improvements

升级的时候会将安装包储存在/opt/1panel/tmp/upgrade目录下 而且重启系统或者更新成功后也不会自动删除
在群晖NAS上这个问题比较严重因为/dev/md0只分配了2.3G 大概更新四五次后就需要手动删除
当然可以用Task Scheduler或者crontab之类的方式自动删除 但是这毕竟浪费了用户调查的时间 也想不出要留着所有旧版本安装包文件的理由

:/opt/1panel/tmp/upgrade$ ll
total 56
drwxr-xr-x 14 root root 4096 Dec 13 14:05 ./
drwxr-xr-x 4 root root 4096 Nov 10 22:01 ../
drwxr-xr-x 4 root root 4096 Jun 24 16:29 upgrade_20240624162953/
drwxr-xr-x 4 root root 4096 Jun 27 13:27 upgrade_20240627132718/
drwxr-xr-x 4 root root 4096 Jul 30 11:02 upgrade_20240730110213/
drwxr-xr-x 4 root root 4096 Aug 29 10:04 upgrade_20240829100448/
drwxr-xr-x 4 root root 4096 Sep 14 10:17 upgrade_20240914101704/
drwxr-xr-x 4 root root 4096 Sep 24 09:30 upgrade_20240924093028/
drwxr-xr-x 4 root root 4096 Oct 15 12:08 upgrade_20241015120801/
drwxr-xr-x 4 root root 4096 Oct 29 10:51 upgrade_20241029105129/
drwxr-xr-x 4 root root 4096 Nov 15 15:02 upgrade_20241115150254/
drwxr-xr-x 4 root root 4096 Nov 19 10:45 upgrade_20241119104516/
drwxr-xr-x 4 root root 4096 Nov 20 13:04 upgrade_20241120130453/
drwxr-xr-x 4 root root 4096 Dec 13 14:05 upgrade_20241213140525/

Please describe the solution you suggest

更新成功后自动删除/opt/1panel/tmp/upgrade下的安装包

Additional Information

No response

@wanghe-fit2cloud
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


1Panel Version

v1.10.22-beta.2

Please describe your needs or suggestions for improvements

During the upgrade, the installation package will be stored in the /opt/1panel/tmp/upgrade directory and will not be automatically deleted after the system is restarted or the update is successful.
This problem is more serious on Synology NAS because /dev/md0 is only allocated 2.3G and needs to be manually deleted after about four or five updates.
Of course, you can use Task Scheduler or crontab to automatically delete it, but this is a waste of user investigation time, and I can’t think of a reason to keep all the old version installation package files.

:/opt/1panel/tmp/upgrade$ ll
total 56
drwxr-xr-x 14 root root 4096 Dec 13 14:05 ./
drwxr-xr-x 4 root root 4096 Nov 10 22:01 ../
drwxr-xr-x 4 root root 4096 Jun 24 16:29 upgrade_20240624162953/
drwxr-xr-x 4 root root 4096 Jun 27 13:27 upgrade_20240627132718/
drwxr-xr-x 4 root root 4096 Jul 30 11:02 upgrade_20240730110213/
drwxr-xr-x 4 root root 4096 Aug 29 10:04 upgrade_20240829100448/
drwxr-xr-x 4 root root 4096 Sep 14 10:17 upgrade_20240914101704/
drwxr-xr-x 4 root root 4096 Sep 24 09:30 upgrade_20240924093028/
drwxr-xr-x 4 root root 4096 Oct 15 12:08 upgrade_20241015120801/
drwxr-xr-x 4 root root 4096 Oct 29 10:51 upgrade_20241029105129/
drwxr-xr-x 4 root root 4096 Nov 15 15:02 upgrade_20241115150254/
drwxr-xr-x 4 root root 4096 Nov 19 10:45 upgrade_20241119104516/
drwxr-xr-x 4 root root 4096 Nov 20 13:04 upgrade_20241120130453/
drwxr-xr-x 4 root root 4096 Dec 13 14:05 upgrade_20241213140525/

Please describe the solution you suggest

After the update is successful, the installation package under /opt/1panel/tmp/upgrade will be automatically deleted.

Additional Information

No response

@wanghe-fit2cloud wanghe-fit2cloud changed the title [Feature] 自动移除/opt/1panel/tmp/upgrade目录下的更新包 [Feature] Automatically remove the update package in the /opt/1panel/tmp/upgrade directory Dec 13, 2024
@wanghe-fit2cloud
Copy link
Member

保留系统升级前的备份文件是为了支持回滚功能。如果确认需要删除,可以通过工具箱的缓存清理功能操作,或者利用计划任务来完成删除。

@wanghe-fit2cloud
Copy link
Member

后续版本可能会考虑支持用户自定义保留的备份数量。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants