Provisioning - New crontab fort virtual servers

5 posts / 0 new
Last post
#1 Tue, 12/15/2009 - 16:25
mcateo

Provisioning - New crontab fort virtual servers

Good day,

I've two server with webmin/virtualmin installed, since few months, when I create a virtual server with AwStats plugin enabled, the creation script add an entry in my crontab for the statistics updates. I need to create another entry for the sitemap building, but i've not found any place in the Webmin/Virtualmin interface useful to to this feature, are there guys able to give me an hint?

Many thanks :-) Regards

Tue, 12/15/2009 - 16:53
andreychek

Howdy,

You can add Cron entries using Webmin -> System -> Scheduled Cron Jobs.

Also, if you log into Virtualmin as a user, I believe that same thing is available in the "Webmin Modules" section on the left of Virtualmin.

-Eric

Tue, 12/15/2009 - 17:05 (Reply to #2)
mcateo

Dear Eric,

you are right, and actually I've used this way to execute the task, but if the Virtualmin/AwStats module it's able to create an automatic entry, I suppose there will be a way to configure Virtualmin in order to do another entry during the Virtual Server creation.

Many thanks Regards

Tue, 12/15/2009 - 21:32
andreychek

Oh I see, so you're looking for an automated way to do that during Virtual Server creation.

Hmm.

I'd probably look into running a command when the Virtual Server gets created. To do that, go into System Settings -> Module Config -> Actions upon server and user creation, and take a look at "Command to run after making changes to a server".

What you could do is write a script that would take advantage of the variables available to you (click on the help link for that option to see the available variables that can help you out).

Your script could simply append a given line to the users crontab file in /var/spool/cron/crontab/$USERNAME.

-Eric

Wed, 12/16/2009 - 09:48
mcateo

Dear Eric,

I've explored your suggestion and I'm able to add the crontab for each new Virtual Server! I'm not able to remove the entry, but I hope to dedicate a few during the next weekend :-)

Many thanks, Regards

Antonino

Topic locked