Last active
April 26, 2023 14:22
-
-
Save thartl/03bb7f2080afddc52a69e3cb7787c2af to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Prints a list of wp cron schedules on servers set up by SpinupWP. | |
# Includes only standard wp cron events, nothing custom. | |
# | |
# Setup: | |
# cd /usr/bin/ | |
# sudo vim get_cron_schedules.sh | |
# -- paste in the contents of this file and save | |
# sudo chmod 755 get_cron_schedules.sh | |
# | |
# Run script as a sudo user | |
cd /home/[sudo user name] | |
crons=$(sudo grep -rHi "wp cron event run --due-now" /var/spool/cron* | sed 's/^\/var.*crontabs\/\(\S*\):\(.*\)\s*cd \/sites\/.*$/\2\\t\1\\n/') | |
crons=$(echo -e $crons | sort -n) | |
echo "$crons" | |
echo Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment