admin管理员组文章数量:1304540
I'm writing a system diagnostic utility and I want data from different servers to be saved as testcases for it.
I want to "archive" a copy of /proc
and /sys
and unpack it as a testcase for my utility. (one testcase for one inspected server).
I understand that procfs and sysfs are very special, so, may be there are libraries/utilitites which are designed for that and can do it properly? Handling all symlinks, skipping inaccessible files, ignoring memory maps, loops, etc?
I'm writing a system diagnostic utility and I want data from different servers to be saved as testcases for it.
I want to "archive" a copy of /proc
and /sys
and unpack it as a testcase for my utility. (one testcase for one inspected server).
I understand that procfs and sysfs are very special, so, may be there are libraries/utilitites which are designed for that and can do it properly? Handling all symlinks, skipping inaccessible files, ignoring memory maps, loops, etc?
Share Improve this question asked Feb 4 at 10:09 Gee ShuklinGee Shuklin 7,93711 gold badges50 silver badges92 bronze badges1 Answer
Reset to default 1You can start experimenting with utility rsync
:
rsync -aHAX --numeric-ids --exclude="*/maps" --exclude="*/mem"\
--exclude="*/kmem" --exclude="*/port" --exclude="*/fdinfo"\
--exclude="*/sysrq-trigger" --exclude="*/kcore"\
--exclude="*/core_pattern" --exclude="*/perf_event_paranoid"\
/proc /sys /tmp/proc-sys-$(date +%FT%T)
本文标签: linuxSaving a copy of proc and sys for testsStack Overflow
版权声明:本文标题:linux - Saving a copy of proc and sys for tests - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741774865a2396963.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论