Which folder should contain my bash scripts
I am using a VPS host, with Cpanel/WHM so I have full control.
On one of the hosting accounts, which is a live website, I have created some bash scripts to run some admin tasks at set times using cron.
The Help desk at the provider is insisting I should have these scripts located in the /public-html folder, and I think they are nuts, but they wont listen to me.
They said that I can secure the script locations, but thats not the point. If I make a human error and expose my scripts to the internet it can cause me problems. By putting my scripts into the home/ folder, then there is zero risk.
Who is right, them or me?
-
Hello, Could you provide more information about what the bash script does? Is it purely for account-specific tasks or does it require the manipulation or use of system-level files that only the "root" user has access to? Thank you. 0 -
Hello, Could you provide more information about what the bash script does?
Thanks account specific tasks, which is why I place the bash script in the relevant home directory. i have a few different ones but one is for emailing a log file and then delete that file. No action on system files and no root required0 -
YOu can place bash scripts in your home folder /home/your_username. That is good option 0 -
If it's a script executed by a non-root user, /home/username is a good place. 0 -
so do you all agree that placing bash scripts in home/username/public_html/ is not recommended? 0 -
public_html should only contain files you want to serve to people; everything else should be outside public_html Anything you want to access through command line or cron should not be in public_html directory 0 -
Thanks, thats what I have been telling tech support. Just needed someone to confirm I was on the right track 0
Please sign in to leave a comment.
Comments
7 comments