Hi everyone. I have a code script that deleting unused logs.
I have this function for it. +5 represents the days. I want to get it from outside, from a config file. How can i do it?
system("find /var/log -name '*.log' -type f -mtime +5 delete");
> I compile it with g++ in my linux.
> It gives me the error : Segmentation fault (core dumped)
Do you have a file called config?
Does it contain what you want?
Did it open the file correctly?
> 'buff' was not declared in this scope
> 'days' was not declared in this scope
See, I assumed you would know how to fill in the blanks and make the appropriate changes.
It seems though you're looking for copy/paste answers that work out of the box.