troubleshooting Question

Tarring files in Linux 6.5

Avatar of John Sheehy
John SheehyFlag for United States of America asked on
LinuxGolang
14 Comments1 Solution210 ViewsLast Modified:
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.txt

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.

Thanks
John
tar_experts.txt
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 14 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros