| Summary: | virt-sysprep to delete more logfiles | ||
|---|---|---|---|
| Product: | [Community] Virtualization Tools | Reporter: | Jan van Eldik <Jan.van.Eldik> |
| Component: | libguestfs | Assignee: | Pino Toscano <ptoscano> |
| Status: | CLOSED UPSTREAM | QA Contact: | |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | unspecified | CC: | acathrow, mbooth, ptoscano, rjones |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-12-09 16:48:15 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Jan van Eldik
2013-12-09 11:49:04 UTC
A few things to note in general:
(1) virt-sysprep upstream (since 1.25.2) has support for deleting
arbitrary files and directories. You do:
virt-sysprep --delete /foo/bar [etc]
It's the same as doing 'rm -rf'.
(2) Even if you don't want to upgrade virt-sysprep, you can post-process
your images with guestfish, eg:
guestfish -a disk.img -i <<EOF
rm-rf /root/anaconda-post.log
glob rm-rf /tmp/*
EOF
-----
About these particular files:
> /root/anaconda-post.log
This needs to be added.
> /tmp/yum.log
> /tmp/ks-script-*
Since virt-sysprep 1.24, /tmp, /var/tmp are emptied properly.
> /var/log/anaconda.syslog
> /var/log/tuned/tuned.log
Both need to be added.
> /var/log/sa/*
Added in virt-sysprep 1.24.
Thanks for the quick reply, Richard, and for the 'glob rm-rf /tmp/*' hint. Fixed upstream by: https://github.com/libguestfs/libguestfs/commit/c89ffbc15291e9418e36540e5e78311b6f39011b in libguestfs >= 1.25.14. And with another upstream commit: https://github.com/libguestfs/libguestfs/commit/ed4bcb119cb908e98ecc1107dcd8b740ee2f484f (always in libguestfs >= 1.25.14) --delete supports globbing, so you can do things like: virt-sysprep --delete '/tmp/ks-script-*' [etc] |