Search Engine: Elastic

Article ID: 2825, created on Oct 29, 2007, last review on May 11, 2014

  • Applies to:
  • Pro Control Panel Linux


View Knowledge
Knowledge ID 2245
Product : Ensim Pro for Linux
Version : 3.5
Topic : Hotfix

How can I create cron jobs for virtual sites?

How can I create cron jobs for virtual sites?


* Replace [X] with the actual associated number for the admin.
You can use sitelookup -d domainname to get the admin number.

All of these commands must be executed as root.

1) Create directory /home/virtual/admin[X]/var/spool/cron

2) Create the file /home/virtual/admin[X]/var/spool/cron/admin[X]

3) To run a command every 5 minutes for example, insert something like this into the above file (this is all one line):

*/5 * * * * touch /home/virtual/admin[X]/tmp/i-was-here

Refer man 5 crontab for more details on the format.

4) Change the ownership of the file to root.admin[X] by doing:
chown root.admin[X] /home/virtual/admin[X]/var/spool/cron/admin[X]

5) Create a symlink in /var/spool/cron by running this command:
ln -s /home/virtual/admin[X]/var/spool/cron/admin[X] /var/spool/cron/admin[X]

Now look for the file i-was-here in /home/virtual/admin[X]/tmp. If you have any doubts about where its working or not. Look at /var/log/cron to see what is going on.

If you Update the file i.e. /home/virtual/admin[X]/var/spool/cron/admin[X], you will need to run command touch /var/spool/cron/ so the cron daemon registers the change.


Related Knowledge

Related Links
Last ModifiedUsageSatisfiedLast Used
6/16/2006 2:08:43 AM905010/11/2007 4:21:38 AM

4cc899da08664637a8bc437308d3ddd7 3ccb419cf98083f3bb45808fba8dbc7c 6311ae17c1ee52b36e68aaf4ad066387

Email subscription for changes to this article
Save as PDF