We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
How to suspend user account autonatically with cron job?
How to suspend user account autonatically with cron job?
Could you please help me to solve this with cron job? Suspend user command is: v-suspend-user
How can I suspend a user for example called loqopedplus with command?
I added cron with this command "sudo /usr/local/vesta/bin/v-suspend-user loqopedplus" but it didn't work. But when I enter this command in putty it works. I add print screen here.
https://drive.google.com/open?id=1UTemI ... 0HpNHJWPcn
I get email notification for this.
/usr/local/vesta/bin/v-suspend-user: line 17: /func/main.sh: No such file or directory
/usr/local/vesta/bin/v-suspend-user: line 18: /conf/vesta.conf: No such file or directory
/usr/local/vesta/bin/v-suspend-user: line 25: check_args: command not found
/usr/local/vesta/bin/v-suspend-user: line 26: is_format_valid: command not found
/usr/local/vesta/bin/v-suspend-user: line 27: is_object_valid: command not found
/usr/local/vesta/bin/v-suspend-user: line 28: is_object_unsuspended: command not found
/usr/local/vesta/bin/v-suspend-user: line 77: /v-restart-web: No such file or directory
/usr/local/vesta/bin/v-suspend-user: line 78: check_result: command not found
/usr/local/vesta/bin/v-suspend-user: line 80: /v-restart-dns: No such file or directory
/usr/local/vesta/bin/v-suspend-user: line 81: check_result: command not found
/usr/local/vesta/bin/v-suspend-user: line 83: /v-restart-cron: No such file or directory
/usr/local/vesta/bin/v-suspend-user: line 84: check_result: command not found
/usr/local/vesta/bin/v-suspend-user: line 87: update_user_value: command not found
/usr/local/vesta/bin/v-suspend-user: line 88: increase_user_value: command not found
/usr/local/vesta/bin/v-suspend-user: line 91: log_event: command not found
How can I suspend a user for example called loqopedplus with command?
I added cron with this command "sudo /usr/local/vesta/bin/v-suspend-user loqopedplus" but it didn't work. But when I enter this command in putty it works. I add print screen here.
https://drive.google.com/open?id=1UTemI ... 0HpNHJWPcn
I get email notification for this.
/usr/local/vesta/bin/v-suspend-user: line 17: /func/main.sh: No such file or directory
/usr/local/vesta/bin/v-suspend-user: line 18: /conf/vesta.conf: No such file or directory
/usr/local/vesta/bin/v-suspend-user: line 25: check_args: command not found
/usr/local/vesta/bin/v-suspend-user: line 26: is_format_valid: command not found
/usr/local/vesta/bin/v-suspend-user: line 27: is_object_valid: command not found
/usr/local/vesta/bin/v-suspend-user: line 28: is_object_unsuspended: command not found
/usr/local/vesta/bin/v-suspend-user: line 77: /v-restart-web: No such file or directory
/usr/local/vesta/bin/v-suspend-user: line 78: check_result: command not found
/usr/local/vesta/bin/v-suspend-user: line 80: /v-restart-dns: No such file or directory
/usr/local/vesta/bin/v-suspend-user: line 81: check_result: command not found
/usr/local/vesta/bin/v-suspend-user: line 83: /v-restart-cron: No such file or directory
/usr/local/vesta/bin/v-suspend-user: line 84: check_result: command not found
/usr/local/vesta/bin/v-suspend-user: line 87: update_user_value: command not found
/usr/local/vesta/bin/v-suspend-user: line 88: increase_user_value: command not found
/usr/local/vesta/bin/v-suspend-user: line 91: log_event: command not found
Re: How to suspend user account autonatically with cron job?
v-suspend-user is not setup for running as cron job, i think following part is missing:
But I think the best way for you is to use the api, for example using a small php script (you can run it over cron) or another way is to use a customer panel like whmcs.
Code: Select all
# Importing system variables
source /etc/profile
Re: How to suspend user account autonatically with cron job?
Coudl you please write complete form of that cron job?, sudo v-suspend-user loqopedplus source /etc/profile?
Re: How to suspend user account autonatically with cron job?
No I can't, in my point of view this is a special customization and not really vesta support. Please use vesta support (https://vestacp.com/support/) or contact any sysadmin, that have at least a little bit knowledge of bash or php scripting.
Re: How to suspend user account autonatically with cron job?
Code: Select all
v-add-cron-job USER MIN HOUR DAY MONTH WDAY COMMAND [JOB] [RESTART]
I have 2 idea's to get this done.
1: add a specific user cron job for suspension and schedule it for that specific date when you want that user to be deleted so command will run on that date only and after that it will be expired. you can add as many suspension command for each users you want. That is the most easy way.
Second solution works almost as above write a script in shell and define a time or date to suspend that user on that date or time add as many lines of commands you want in that script and then add that shell script to cron job.
i know i did not explained much but if you are a bit of genius you will get to the point and will get this done.