Page 1 of 1

How Can I Add This cron job?

Posted: Tue Sep 24, 2019 5:46 pm
by UbunVesta
Hello,

Currently I'm running vestacp on ubuntu 16.04 LTS

Now, I need to add this cron job for my wordpress website

How I can add this?

Code: Select all

#!/bin/bash

# get the list of proxies from AWS
IPS=`curl -s http://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips | jq -r '.[][]'`

# use wp-cli to update WordFence config in database
cd httpdocs
wp db query "UPDATE wp_wfconfig SET val = '$IPS' WHERE name = 'howGetIPs_trusted_proxies';"

# remove the WordFence config cache so the new IPs will be read on next page load
rm wp-content/wflogs/config-synced.php
Thanks :)

Re: How Can I Add This cron job?

Posted: Tue Sep 24, 2019 6:30 pm
by grayfolk
Create .sh file with this code, for example cron.sh
Make chmod +x cron.sh
Then just add cron job with call this file.