How to automatically create a cron job

Hi,

is there a way to create a cron job when creating a new vHost? I didn't find a way to do it from the Server Templates.

Thanks

Gerald

Status: 
Closed (fixed)

Comments

Sorry, no .. at least not from templates.

The only method would be to use a post-creation script with code like :

#!/bin/sh
if [ "$VIRTUALSERVER_ACTION" = "CREATE_DOMAIN" ]; then
  echo "$VIRTUALSERVER_USER 0 0 * * * /path/to/command" >/etc/cron.d/$VIRTUALSERVER_DOM
fi

This creates a cron job file that runs as the domain's user.

Thanks,

I'll see into it.

Gerald

Automatically closed -- issue fixed for 2 weeks with no activity.