Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
list crontabs from all gcp servers
#!/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
You can’t perform that action at this time.