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.
running a bash script via cron
running a bash script via cron
I added a cron job to run a bash script.
However, it does not run! It runs fine when i execute it manually. I do not see the entry in the cron log either. What could be the issue?
Regards
RK
However, it does not run! It runs fine when i execute it manually. I do not see the entry in the cron log either. What could be the issue?
Regards
RK
Re: running a bash script via cron
What's errors do you see on your email?
This command runs under admin or another user?
Do you enable bash for admin or another user?
This command runs under admin or another user?
Do you enable bash for admin or another user?
Re: running a bash script via cron
hello
this is the error i receive via email.
sudo: no tty present and no askpass program specified
This command runs under admin account.
Not sure if bash is enabled for admin. how to check it?
RK
this is the error i receive via email.
sudo: no tty present and no askpass program specified
This command runs under admin account.
Not sure if bash is enabled for admin. how to check it?
RK
Re: running a bash script via cron
On main user page of VestaCP
Re: running a bash script via cron
yes, the ssh access is set to bash on the admin page.
Re: running a bash script via cron
Try to run this command via ssh and publish the result here
Re: running a bash script via cron
Enter the password for adminok, its asking for password of admin
[sudo] password for admin:
Re: running a bash script via cron
i have searched the internet for the possible solutions.
i added this line to the visudo file
admin ALL=(ALL) NOPASSWD:/bin/bash
but no luck... i am still being prompted for password. please help.
i added this line to the visudo file
admin ALL=(ALL) NOPASSWD:/bin/bash
but no luck... i am still being prompted for password. please help.
Re: running a bash script via cron
How your sudoers look like?
/etc/sudoersShow
Code: Select all
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Defaults env_keep="VESTA"
Defaults:admin !requiretty
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
Re: running a bash script via cron
here is my sudoers file
Code: Select all
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
%admin ALL=(ALL) ALL
## Allows members of the 'sys' group to run networking, software,
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS
## Allows people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL