Howto stop the account set on 1th of every month?

jeffery

Verified User
Joined
Jan 13, 2004
Messages
177
I would like to cancel the bandwidth reset on every 1th of the month, instead, can I manually reset the bandwidth record of a specific account??


Aftering searching the forum, I can manually reset the bandwidth of a account, but i still cannot cancel the monthly reset!

=)


Thanks!!
 
Last edited:
I would like this as well; it would enable us to track bandwidth use on day-of-month to day-of-month hosting.

Jeff
 
Ya, because my hosting account not ends at every 1st of each month..
 
To kill the monthly reset, open /etc/cron.d/directadmin_cron and edit the
Code:
20 8 1 * * root echo 'action=reset&value=all' >> /usr/local/directadmin/data/task.queue
line out. :)
 
l0rdphi1 said:
To kill the monthly reset, open /etc/cron.d/directadmin_cron and edit the
Code:
20 8 1 * * root echo 'action=reset&value=all' >> /usr/local/directadmin/data/task.queue
line out. :)


Can you kindly describe what is this line about?
I am asking what's mean by the code "20 8 1 * *" ?

I am learning to create my own cron job~
 
Actually, the 20 8 1 * * part is a customization of my own, yours probably is: 20 1 1 * *

This tells cron to run the command in the 20th minute, of the first hour, on the 1st day of each month.

There are some good cron guides which explain this much better than I have time for. See here for an example.
 
That's not really the answer to our needs because it's all or nothing.

Is there documentation available on the reset command anywhere so we can figure out how to use it?

Can it be rewritten so it runs nightly, and looks at a database to see when to reset certain domains/users?

Should this post be moved to "feature requests"?

:)

Jeff
 
To change the time/day/duration on the reset you would need to simply modify the cronjob, I have not looked at the cron link Phil provided although im certain you will find information on running crons daily at a set hour/minute... its simply the numbers at the start of the cron line.

Or is it something else you are trying to do?

Chris
 
You can reset a specific user by running:
Code:
echo 'action=reset&value={username}&type=user' >> /usr/local/directadmin/data/task.queue

So sure, you can set up a database right now and have a script look at it, and on the proper day have the script run the reset command for the respective user.
 
I know cron well; it's that scripting to read from a database.

I hope John and Mark will consider adding this to a coming build.

Crhis, can you move this to "feature request"?

Thanks.

Jeff
 
why not just remove the line from the directadmin_cron then use the upon site creation/removal scripts to add / remove the particular users cron?

/etc/cron.d/da_user_cron

cron_user1_line
cron_user2_line

each setup so the cron runs the day of the month the account was created (and then a script to add a line for all current users using default days?)

That would be an easy script an I would be happy to write a temp application then put a more in depth script with the tool im developing atm.

Chris
 
People won't appreciate manual work,
if DA is able to set specific reset time for each user, it is not a bad idea.

Writing additional scripts to achieve the target is not difficult, but why not make DA more functional by integrating into it?

Moreover, not all people checkout this fantastic forum, and they may miss those unofficial scripts~ :)
 
But the difference between "manual" and ? is?

It would work automatically for each site and installation would simply be

wget (url)
./install

or even:

rpm -ivh (url) for RH

Im sure if its wanted I can develop, and once its tried we can see it officially... if its going to be put in DA by DA then I think the best option (if it was to be a menu) would be a drop down for

Bandwidth reset date: [01[^]

Chris
 
My 'manual' definition is that admin need to "manually" SSH into the user account to set the cron job file.

It is certainly a good idea if a script can integrate into DA and let the Linux newbie (like me) to set the bandwidth reset date easily.

What I claim is, instead of writing separate script for separate task, why not "ALL" plugged (of course ones that are useful..) into DA and make DA more powerful?

Chris is always a helpful guy here~


:D
 
jeffery said:
My 'manual' definition is that admin need to "manually" SSH into the user account to set the cron job file.

Nope, as I said above it would simply be the initial setup (and that can be covered in the script..)

why not just remove the line from the directadmin_cron then use the upon site creation/removal scripts to add / remove the particular users cron?


(like:)

/etc/cron.d/da_user_cron

cron_user1_line
cron_user2_line

It would be one initial setup only, then its fully automated :)

Jeff, is that what you are looking for also?

Chris
 
ProWebUK said:
Nope, as I said above it would simply be the initial setup (and that can be covered in the script..)


Ha~ I mean if there is no script, we have to do it right by removing a line in the cron file! :D



It would be one initial setup only, then its fully automated :)

Chris

Seems powerful~ :rolleyes:
 
Chris, I appreciate your offer, and would certainly support your script, distribute it, etc., if you write it.

I'd rather see it integrated into DirectAdmin.

So give a yell to Mark & John...

Perhaps if you write the script they'll integrate it.

But note that a dropdown box would be much better than a script; sometimes you don't want the data reset on the anniversary date of the site creation.

And don't forget, if you do write the script, to allow for a site created on January 30th to have the data reset on February 28th (unless it's a leapyear, in which case it should be February 29th).

I think it would be a lot easier if we had it integrated into DA with a dropbox.

Jeff
 
i wonder how other control panel resolve this problem?

i also use cpanel, it resets on the 1st of every month as well.
 
Back
Top