Created
July 15, 2019 17:32
-
-
Save sebastianwebber/ab93fb96450f063c45a70ff8fe2826a1 to your computer and use it in GitHub Desktop.
list crontabs from all gcp servers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
server_list=$(gcloud compute instances list --format='get(networkInterfaces[0].networkIP)' --filter="status=running") | |
for server in ${server_list[@]}; do | |
echo "server: $server" | |
ssh $server 'sudo cat /var/spool/cron/* /etc/crontab' | |
echo "-----------" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment