Goal:
Find log files, in a specific directory, generated in a 24hr period (could be THOUSANDS), then sum up the size of the result so as to know how much space is being used in a given 24hr period.
Commands tried so far:
- 'find ./ -type f -mtime -1 -exec du -sch'
The 'du' command is tallying up EACH file, instead of the whole result
- 'find ./ -type f -mtime -1 | xargs du -sch'
This gives a false result because xargs breaks the results (from find) into chunks of lines so as to not exceed the buffer limit, which throws off the du command
Suggestions/Help is much appreciated!
Thanks.
Find log files, in a specific directory, generated in a 24hr period (could be THOUSANDS), then sum up the size of the result so as to know how much space is being used in a given 24hr period.
Commands tried so far:
- 'find ./ -type f -mtime -1 -exec du -sch'
The 'du' command is tallying up EACH file, instead of the whole result
- 'find ./ -type f -mtime -1 | xargs du -sch'
This gives a false result because xargs breaks the results (from find) into chunks of lines so as to not exceed the buffer limit, which throws off the du command
Suggestions/Help is much appreciated!
Thanks.