1. By Using your WebHosting.
The procedure of setting up a CRON Job using Webhosting depends on the type of hosting. Due to the
fact that there are many types of web-hostings out there, we cannot detail CRON setup procedure for
each. If you have cPanel on your hosting, you may use the below method, otherwise kindly consult your
Hosting's support for setting up a CRON Job.
In cPanel, you will see a section named "Advanced". In it, will be an item name "CRON Jobs". Click on
it to go to the CRON Job's page.
The file that needs to run regularly as CRON is named cron.php and is present in the root of the script.
Ideally, CRON job should run every minute, but you may, if required, set it to run every 5 minutes or more.
If you do setup the CRON to run every 5 minutes for example, a group post scheduled for say, 11:27pm
will only be published at 11:30pm (that is, on the next CRON run).
Here is what a typical CRON Command looks like;
/usr/local/bin/php "/home/olkumfvp/public_html/wp-content/uploads/scripts/script
v.1.14/cron.php" >> "/home/olkumfvp/public_html/wp-content/uploads/scripts/script
v.1.14/cronlog.txt" 2>&1
/usr/local/bin/php is the path to PHP.
"/home/olkumfvp/public_html/script/cron.php" is the path to the cron.php file on server.
"/home/olkumfvp/public_html/script/cronlog.txt" indicates where to save logs for cron.
System will create this file if it does not exist
2>&1 Keep this as is.
Merhabalar,
Burada size zamanlanmış görevlere (cronjob) nasıl iş ekleyeceğiniz anlatılıyor. Çeviri şu şekilde.
Web hostinglerde Cron Job kurulumu kullandığınız web hosting tipine bağlı olarak değişkenlik göstermektedir. Çok fazla farklı tipte web hosting mevcut olduğundan dolayı size ayrıntılı Cron Job kurulumunu her birisi için ayrı ayrı sunamıyoruz. cPanel kullanıyorsanız, aşağıdaki yer alan adımları takip edebilirsiniz, aksi taktirde servis sağlayıcınızdan CronJob kurulumu için danışmanlık almanızı şiddetle öneriyoruz.
cPanel'de "Gelişmiş" adında bir bölüm göreceksiniz. Bu bölümde "Cron Jobs" isimli bir eleman bulunmalı. Buna tıklayarak "Cron Jobs" sayfasına gidiniz.
Düzenli olarak çalıştırılması gereken dosyanın adı cron.php dosyası ve bu dosya sizin scriptinizin kök dizininizde yer alıyor.
İdeal olarak, Cron Job her dakika çalışmalıdır. Ama ihtiyaç halinde bunu her 5 dakikada bir veya daha seyrek olacak şekilde ayarlayabilirsiniz.
Cron'u her 5 dakikada bir çalışacak şekilde ayarladığınızda örneğin 11:27'de yayına girmesi için zamanladığınız girdiler yayına 11:30'da girecektir.
Sıradan bir Cron komutu aşağıdaki gibi görünecektir.
/usr/local/bin/php "/home/olkumfvp/public_html/wp-content/uploads/scripts/scriptv.1.14/cron.php" >> "/home/olkumfvp/public_html/wp-content/uploads/scripts/scriptv.1.14/cronlog.txt" 2>&1
/usr/local/bin/php: bu sizin php yolunuz
"/home/olkumfvp/public_html/script/cron.php": bu cron.php'nin sunucudaki yolu
"/home/olkumfvp/public_html/script/cronlog.txt": bu sizin loglarınızın yer alacağı dosya, eğer böyle bir dosya yok ise sistem bu dosyayı kendisi yaratacaktır
2>&1: Bu bölüm de scriptin çalışması sırasında oluşan hataların da yine aynı log'a yazılmasını sağlayacaktır.
İyi çalışmalar.