So we have 544 Linux machines
They all send their audit.log to the syslog server
Some of the logs are getting quite big and need to be tarred/compressed and stored on the backup sever to be backed up.
So I wrote a script that tells me what folders are over 1 gig
du -h --max-depth=1 /mnt/rsyslog/ | grep '[0-9]G\>' | sort -hr >/mnt/rsyslog/audit/Over1G
That gives me a listing of folders that are over 1G and outputs to the text file
Currently I am having to go to each folder and tar the file to the backup server, remove the file, then remove the directory.
repeat steps for next machine
Is there a way to write a script that will do what I do via the script?
Attached is what I do.