New answers tagged

0

Done in 2 steps Tested and worked fine in both scenarios a. cp orginalfile fileneedto_be_changed'(Need to do only one Time) orginalfile=====>which supposed to be changed b. differencecount=`awk 'NR==FNR{a[$0];next}!($0 in a){print $0}' orginalfile fileneedto_be_changed|wc -l` if [ $differencecount -eq 0 ] then echo "NO changes in file" else echo "...


0

if you are checking changes in a git repo, you can use: #!/usr/bin/env bash diff="$(git diff | egrep some_file_name_or_file_path | cat)" if [[ -n "$diff" ]] ; then echo "==== Found changes: ====" echo "diff: $diff" exit 1 else echo 'Code is not changed' fi


0

Not enough reputation to comment, but for psrecord you can also call it directly, in a programmatic way, directly in Python: from psrecord.main import monitor monitor(<pid number>, logfile = "./test.log", plot="./fig.png", include_children=True)


1

While it might not give you enough control (yet?) I have written a program, which at least partially fulfills your needs, using the linux-kernel's fanotify and unshare to monitor only files modified (or read) by a specific process and its children. Compared to strace, it is quite fast (; It can be found on https://github.com/tycho-kirchner/shournal Example ...


0

You can also take a look at the Linux auditing subsystem, nice docs for RHEL are at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security_guide/chap-system_auditing. You can add rules, which log events in the audit log, and parse the audit log to do whatever you like with it.


0

I believe that you can do at least some of what you're looking for With Sysdig 'Chisels`. Sysdig is an open-source tool that enables you to monitor Linux system calls. The chisels enable you to write scripts to perform actions based on the observed system calls. Take a look at the user guide


Top 50 recent answers are included