signupindia
signupindia

Reputation: 59

FeedWordPress cron job code

FeedWordPress (RSS fetcher) plugin of WordPress is working well, but it doesn't have an option to update RSS every 5 minutes (default is 60 minutes) so the only way is clicking the UPDATE NOW button manually.

I am new and some guys told me to trigger it every 5 minutes using a cron job, so I tried that in cpanel

First I tried this

curl http://domain.com/?update_feedwordpress=true > dev/null

but was getting this error

/bin/sh: dev/null: No such file or directory

Second I tried this

wget http://domain.com/?update_feedwordpress=1

but now I'm getting this error

/bin/sh: /usr/bin/wget: Permission denied

(I used my domain.com in that place)

Any correct/exact working code?

Upvotes: 2

Views: 428

Answers (2)

Ahmad Shahbaz
Ahmad Shahbaz

Reputation: 222

You can use this code:

/usr/local/bin/curl --silent -L  "http://example.com/?update_feedwordpress=1" >/dev/null 2>&1

where you should replace example.com with your domain name.

Upvotes: 1

Jayan
Jayan

Reputation: 18458

Null device is /dev/null

The /usr/bin/wget does not seems to have permission to execute for the current user.

It may be easier to write a script (say mydebug.sh ) and run the script with cron

id
ls -l /usr/bin/wget

curl ...

Then check for any obvious errors due to permissions.

Upvotes: 0

Related Questions