LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-09-2008, 02:07 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Specific Directory Safe for Scripts


I have a few shell scripts written in bash & was moving them to a new server and I was wondering if it makes any difference where I add them? Is there a specific directory where one "generally" places scripts that are run via cron?

Obviously in crontab, I add the full path of the script but I want to know if there is a general rule of thumb as to where it is safe to place scripts.
 
Old 09-09-2008, 02:10 PM   #2
CRC123
Member
 
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Blog Entries: 1

Rep: Reputation: 32
Generally you place all you're personal scripts in your home directories bin folder (~/bin) if it has one.
 
Old 09-09-2008, 02:11 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by CRC123 View Post
Generally you place all you're personal scripts in your home directories bin folder (~/bin) if it has one.

No, my users home directory is empty minus hidden files. I generally also don't run the scripts as a specific user but as root so I would basically just be throwing them in my home directory, right?
 
Old 09-09-2008, 02:12 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
If you are the system admin, /usr/local/bin or /usr/local/sbin would seem to be good places. If you are not an admin, a sub-directory called "bin" under your HOME directory is quite common.

Another location is /opt/bin or /opt/packagename/bin where "packagename" is the name of some app or other.

See the Linux FHS for fully descriptions of these directories.
 
Old 09-09-2008, 02:14 PM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by matthewg42 View Post
If you are the system admin, /usr/local/bin or /usr/local/sbin would seem to be good places. If you are not an admin, a sub-directory called "bin" under your HOME directory is quite common.

Another location is /opt/bin or /opt/packagename/bin where "packagename" is the name of some app or other.

See the Linux FHS for fully descriptions of these directories.
Thanks. That about sums it up!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
is it safe to remove /media directory? johngreenwood Slackware 2 12-26-2006 01:37 PM
Searching a specific directory for a specific extension? RoaCh Of DisCor Linux - Newbie 3 08-13-2005 03:28 PM
Is it safe to remove the startup scripts? Retrievil_Knievil Linux - Hardware 3 04-14-2004 04:12 PM
Help Needed: Looking for specific php software/scripts flamesrock Linux - Software 5 01-19-2004 03:42 PM
User Specific Startup scripts carbonnb Linux - Newbie 2 07-02-2003 06:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration