Month: November 2015

WordPress Multisite Crontab using WP-CLI Raw

WordPress Multisite Crontab using WP-CLI Raw

WP_PATH="/var/www/site_path" for SITE_URL in = $(wp site list –fields=domain,path,archived,deleted –format=csv –path="$WP_PATH" | grep ",0,0$" | awk -F ',' '{print $1 $2}') do echo $SITE_URL for EVENT_HOOK in $(wp cron event list –format=csv –fields=hook,next_run_relative –url="$SITE_URL" –path="$WP_PATH" | grep 'now$' | awk -F ',' '{print $1}') do 

AWS S3 Sync using Crontab

AWS S3 Sync using Crontab

Install AWS cli #Download cli script curl “https://s3.amazonaws.com/aws-cli/awscli-bundle.zip” -o “awscli-bundle.zip” #unzip unzip awscli-bundle.zip #install ./awscli-bundle/install -b ~/bin/aws Create crontab script file : sync-s3.sh #/bin/bash export AWS_CONFIG_FILE=”/root/.aws/config” #change it as per user export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXHRQ export AWS_SECRET_ACCESS_KEY=XXXXXXXfHyR /usr/local/bin/aws s3 sync /var/www/testsite.com/htdocs/wp-content/uploads s3://my-imagestore/ –acl=public-read –debug Add crontab to