Skip to content

Instantly share code, notes, and snippets.

@sparrc
Last active April 21, 2023 21:11
Show Gist options
  • Save sparrc/bece237a9d7fcd409a6555be08e50c2a to your computer and use it in GitHub Desktop.
Save sparrc/bece237a9d7fcd409a6555be08e50c2a to your computer and use it in GitHub Desktop.
cats all cgroup files in ecs and docker cgroups (for cgroups v1 system)
#!/usr/bin/env bash
set -x
rm -rf /tmp/cgroup-ecs && touch /tmp/cgroup-ecs
rm -rf /tmp/cgroup-docker && touch /tmp/cgroup-docker
for f in $(find /sys/fs/cgroup -type f | grep "/ecs/" | sort -h); do
echo $f >>/tmp/cgroup-ecs
cat $f >>/tmp/cgroup-ecs
printf "\n\n" >>/tmp/cgroup-ecs
done
for f in $(find /sys/fs/cgroup -type f | grep "/docker/" | sort -h); do
echo $f >>/tmp/cgroup-docker
cat $f >>/tmp/cgroup-docker
printf "\n\n" >>/tmp/cgroup-docker
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment