Search the Community
Showing results for tags 'cron'.
-
What is a cronjob ? A cronjob is a service that allows a user to automatically execute a script at a specific time. For example, you can set a particular PHP script to be automatically executed everyday at midnight. How to find the cronjob command ? Go to your website admin / tools / Cronjob To run all the cron just add in your Cpanel this line : wget http://mywebsite.com/index.php?cronjob&runall --read-timeout=5400 Setup in cPanel : Set up cron jobs through cPanel using this procedure: Log on to your cPanel Interface. Go to 'Advanced' section. Click on "Cron Jobs". Select the specific time from the lists provided. You should enter the command to run in the "Command" field. You should make sure to enter the proper command and the full path to the file.
-
Hello, This tutorial allow you to create a cron to save your db in daily. if you want to change the delay, you can use this site to help you : https://crontab-generator.org/ Inside your server create a files : saveCronTabDb.sh with execute right (chmod 755) #!/bin/bash DB_USER='MyUserName' DB_PASS='MyPassword' DB_HOST='localhost' DB_NAME='MyTable' mysql -u${DB_USER} -p${DB_PASS} -h${DB_HOST} $DB_NAME < "/var/www/xxx/xxx/web8/web/myDbdirectory/myDbfilesToSave.sql" Now you can create your crontab with this command: In this case all the 21hr everyday * */21 * * * /var/www/xxx/xxx/web1/private/saveCronTabDb.sh > /var/www/xxx/xxx/web1/private/cron.log To test your cron : sh saveCronTabDb.sh To see your cron sudo crontab -l Ah do not forget to protect your directory with an htaccess # Disable directory browsing Options -Indexes <Files .htaccess> Order allow,deny Deny from all </Files>