quick awk trick


While managing a Bacula environment, I occasionally found it useful to find savesets that were still on the Storage Node beyond the life of our retention policy.

Since Bacula does not actually erase old volumes if the client next contacts the server again, they hang around and it usually requires manual intervention.

    find . -mtime +30d -print | xargs du | awk '{ sum += $1;count++ }END{print (sum/1024/1024),count}'