2008-08-18 10 views

答えて

31

私が得た情報:

/usr/local/sbin  custom script meant for root 
/usr/local/bin  custom script meant for all users including non-root 

chatlogがirc.debianから切れ端。ORG #debian:

(02:48:49) c33s: question: where is the _correct_ location, to put custom scripts 
for the root user (like a script on a webserver for createing everything needed 
for a new webuser)? is it /bin, /usr/local/bin,...? /usr/local/scripts is 
mentioned in (*link to this page*) 
(02:49:15) Hydroxide: c33s: typically /usr/local/sbin 
(02:49:27) Hydroxide: c33s: no idea what /usr/local/scripts would be 
(02:49:32) Hydroxide: it's nonstandard 
(02:49:53) Hydroxide: if it's a custom script meant for all users including 
non-root, then /usr/local/bin 
(02:52:43) Hydroxide: c33s: Debian follows the Filesystem Hierarchy Standard, 
with a very small number of exceptions, which is online in several formats at 
http://www.pathname.com/fhs/ (also linked from http://www.debian.org/devel/ and 
separately online at http://www.debian.org/doc/packaging-manuals/fhs/fhs-2.3.html) 
(02:53:03) Hydroxide: c33s: if you have the debian-policy package installed, it's 
also in several formats at /usr/share/doc/debian-policy/fhs/ on your system 
(02:53:37) Hydroxide: c33s: most linux distributions follow that standard, though 
usually less strictly and with more deviations than Debian. 

おかげで水酸化

+0

ああに出て行く、素晴らしいです!ありがとうございました! –

19

ユーザーが作成したスクリプトを使用しているユーザーのcrontabについては、通常、それらをホームディレクトリのbinフォルダまたはscriptsフォルダに入れます。/usr/local/scriptsディレクトリにあります。

3

私は、ファイルがユーザーによって作成された場合、彼がそれを作っていなければ彼のユーザーディレクトリ(/ home/username)に入り、それはもっと複雑になると強く信じています。私は過去に/ usr/local/bin、/ bin、/ usr/local/scriptsのいずれかに置いていましたが、etchについてはわかりませんが、/ usr/local /スクリプトは実際にはCronの$ PATHにあります。

2

/home/username/binはどうですか?

〜/ binを$ PATHに追加し、スクリプトをchmod + x filenameで実行可能にします。

2

は個人的に私はbinフォルダが隠されている。この方法

/home/username/.bin 

を好むが、あなたはまだPATHに追加し、内部xビットですべてのスクリプトを実行することができます。

私のホームディレクトリは、ごくわずかなフォルダで一見するときれいであることが好きです。

8

興味のある人のために、Filesystem Hierarchy Standard (FHS)は標準文書であり、依然として非常によく読まれています。私はほぼすべてのLinuxディストリビューションの基盤について説明しており、正式に承認されています。 DebianおよびLinux Standards Base(LSB)によって提供されています。

あなたはその質問に対して肯定的な回答はありませんが、それは定義されていませんから;-)。私が言うことができるのは、/ binに入れないでください(/ usr/binには入れません)。/usr/local/scriptsも例外ではありません。 $ HOME/binは、スクリプトがこの単一のユーザーによってのみ使用されている場合、受け入れられる場所であるようです。

3

Debian guideそれはUbuntuのことになると非常に便利になります

通常、プログラムは/ usr/local以下のディレクトリに自分自身をインストールします。それは

/usr/local/binは、ガイドに従って許容されると思わシステム管理者(またはユーザ)の私的使用のために予約されているのでしかし、Debianパッケージは、そのディレクトリを使用してはいけません。

私は個人的に私のスクリプトを$HOME/.scriptsに入れました。

LSBがこの質問に具体的に対処したいと思っています。

関連する問題