To accomplish this, you'll need to remove the following line from the /etc/cron.d/directadmin_cron:
|
40 1 1 * * root echo "action=reset&value=all" >> /usr/local/directadmin/data/task.queue
|
Now to get a user to be reset, you'll have to tell the system to do it via a cron job which has to be created. To do this, we'll use the custom creation scripts to do the work.
contents of /usr/local/directadmin/scripts/custom/user_create_post.sh:
|
#!/bin/sh
day=`date +"%d"`
if [ "$day" -gt 28 ]; then day=1; fi
echo "0 0 $day * * root echo 'action=reset&value=$&type=user' >> /usr/local/directadmin/data/task.queue" > /etc/cron.d/$;
chmod 755 /etc/cron.d/$
killall -HUP crond
exit 0;
|
contents of /usr/local/directadmin/scripts/custom/user_destroy_post.sh:
|
#!/bin/sh
rm -f /etc/cron.d/$
exit 0;
|
Then chmod both files to 755:
|
chmod 755 /usr/local/directadmin/scripts/custom/user_create_post.sh
chmod 755 /usr/local/directadmin/scripts/custom/user_destroy_post.sh
|
If you have any existing users on your system, you'll have to manually create the files for them in /etc/cron.d/username.
That's it :)
Note: this can be a security hole if you have other files in /etc/cron.d. For example, if someone created a user called "systat", if that script exists, it would be overwritten and it's contents would not be run.