Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
list crontabs from all gcp servers
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 "-----------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment