|
|
|
The crontab manager can be used to run commands at a certain time every day/week/month. It can be used to run commands for web users as well as for the main account.
Usign the Crontab Manager
Once you are logged in to siteadmin, as outlined in this tutorial, click Crontab.

To create a new cronjob, select which user the cron is for (unless you have created any web users there will only be your main login in the dropdown box), then click Add New Task.

Fill in the fields, giving the time you want the cron to be run.
For instance, if you wish to run it every 15 minutes, in the minute field type */15. Once you have entered all the details, click the OK button.
To alter the email address that cron messages are sent to, update the address in the Send crontab messages to address box then click Set.

For further assistance, please refer to this flash based tutorial ->
For Plesk 7 see -> http://support.34sp.com/control-panel-tutorials/plesk-7/using-crontab
For Plesk 8 see -> http://support.34sp.com/control-panel-tutorials/plesk-8/using-crontab
Using the Example cronjobs
To set a cronjob to run awstats automatically every night, you would use:
55 3 * * * ~/cgi-bin/awstats/awstats.pl -config=yourdomain.ext (Please replace .ext with .com /.co.uk /.net etc)
To set a cronjob to run a php script every hour, you would use:
0 * * * * /usr/local/bin/lynx -dump http://www.YOURDOMAIN/path/to/your/file.php
To set a cronjob to backup your database, and mail it to you every Sunday, you would use:
0 0 * * * /usr/local/psa/mysql/bin/mysqldump --opt -u YOUR_DATABASE_USERNAME -pYOUR_DATABASE_PASSWORD YOUR_DATABASE_NAME |gzip |uuencode backup.sql.gz |mail -s "Database backup" YOUR_EMAIL_ADDRESS
(Please replace YOUR_DATABASE_USERNAME / PASSWORD / NAME with your actual database details, please also note that you must NOT have a space between the -p and your password
Please also replace YOUR_EMAIL_ADDRESS with your actual email address)
To set a cronjob to backup your database, and mail it to you every Sunday, you would use:
0 0 * * * /usr/local/psa/mysql/bin/mysqldump --opt -u YOUR_DATABASE_USERNAME -pYOUR_DATABASE_PASSWORD YOUR_DATABASE_NAME > /usr/local/psa/home/vhosts/YOUR_DOMAIN/httpdocs/database.sql
(Please replace YOUR_DATABASE_USERNAME / PASSWORD / NAME with your actual database details, please also note that you must NOT have a space between the -p and your password
Please also replace YOUR_DOMAIN with your actual domain name, without the www. part)
 |
|
|
|
There are no related articles
|
|
|