Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
サーバ作業の注意コマンド
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
S-cubism
December 22, 2017
Technology
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
サーバ作業の注意コマンド
S-cubism
December 22, 2017
More Decks by S-cubism
See All by S-cubism
WSLでreactの開発環境作った話
scubism
0
730
未経験者がAndroidアプリをリリースするまで
scubism
0
150
scubism_LT_20180223_細田謙二_イベントソーシング
scubism
0
160
REVEAL.JSをちょっとだけ使ってみた
scubism
0
280
忙しい人のための仮想通貨
scubism
0
130
最近勉強してること、次にやりたいこと
scubism
0
130
FOOD TECH
scubism
0
80
Firebase(Realtime Database)について
scubism
0
140
複数会社複数リポジトリでのソース管理
scubism
0
110
Other Decks in Technology
See All in Technology
【Google Cloud Next Tokyo'26】Gemini Enterprise と Oracle AI Database で実現する、業務データ活用を実現する AI エージェント実装
shisyu_gaku
0
230
ラジオの科学
frievea
0
270
20260801_スクフェス大阪
kgnkhkr
2
1.2k
【CEDEC2026】次世代デジタルカードゲームのサーバー設計と運用 〜『Shadowverse: Worlds Beyond』の舞台裏~
cygames
PRO
1
950
『三匹の子ぶた』から学ぶネットワークセキュリティの昔と今 / Network Security: Then and Now Through the Lens of The Three Little Pigs
nttcom
1
1.7k
【CEDEC2026】ゲームシナリオライターを支援するAIツール開発の実践 ― 設計とプロンプトの工夫 ―
cygames
PRO
1
770
20260804_Q4AzureUpdateBite_FabricDataAgentの精度を高める設計.pdf
matayuuu
1
110
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.1k
組織にどうSREを根付かせるか?〜IVRyの場合〜
abnoumaru
0
330
TypeScript入門 2026
recruitengineers
PRO
2
480
名古屋の市バスGTFS-JPデータ×スガキヤ 最寄りバス停検索をAmazon ElastiCache Serverless for Valkeyで最適化する
usanchuu
1
440
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
19k
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
How to build a perfect <img>
jonoalderson
1
5.9k
New Earth Scene 8
popppiees
3
2.5k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.3k
Raft: Consensus for Rubyists
vanstee
141
7.6k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
350
Tell your own story through comics
letsgokoyo
1
1k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Building AI with AI
inesmontani
PRO
1
1.1k
How to train your dragon (web standard)
notwaldorf
97
6.7k
Transcript
0 Linux サーバ作業の注意コマンド S-cubism エンジニア勉強会 2017/12/22 S-cubism Inc.
バージョン CentOS release 6.9 (Final)
• crontab • hostname • shutdown, reboot • rm, cp,
mv • vi 2
• crontab • hostname • shutdown, reboot • rm, cp,
mv • vi 3
crontab crontab [オプション] オプション: -l 現在の設定を標準出力 -e cron編集 -r 削除
4
crontab 5
crontab crontab {ファイル} ファイルを読み込んでcrontabに設定する 6
crontab # crontab -l > cron_daily_file.txt # vi cron_daily_file.txt 00
13 * * * root /root/lunch.sh # crontab cron_daily_file.txt 7
crontab # vi cron_daily_file.txt 00 13 * * * root
/root/lunch.sh 00 13 * * 8 root /root/lunch.sh # crontab cron_daily_file.txt "cron_daily_file.txt":2: bad day-of-week errors in crontab file, can't install. 8
• crontab • hostname • shutdown, reboot • rm, cp,
mv • vi 9
hostname • ホスト名を表示,設定する • hostname [オプション] [ホスト名] オプション なし ホスト名の取得
-f long host name (FQDN) 10
hostname $ hostname … gethostname() $ hostname {ホスト名} … sethostname()
11
hostname $ hostname -v gethostname()=`localhost.localdomain' localhost.localdomain gethostname()システムコール →uname() システムコール →現在稼働中のカーネルについての名前と情報を得る
12
hostname /etc/sysconfig/network HOSTNAME=xxxxx.xxxxx $ hostname xxxxx.xxxxx HOSTNAMEの設定をしないとlocalhostになる模様 /etc/hostsの設定(127.0.0.1の先頭)に「xxxxx.xxxxx」がない場合 $hostname -f
hostname: 不明なホスト → 13
hostname hostname(オプションなし) ↓ uname -n -n print the network node
hostname を使う 14
• crontab • hostname • shutdown, reboot • rm, cp,
mv • vi 15
shutdown, reboot # shutdown now # init 0 ※電源切れても問題ない環境でお試しください。 16
shutdown, reboot # shutdown -r now # reboot # init
6 ※電源切れても問題ない環境でお試しください。 17
• crontab • hostname • shutdown, reboot • rm, cp,
mv • vi 18
rm, cp, mv sudo rm -rf * historyなんかで残ってて「↑」カーソル「Enter」などやってしまう場合もあるの で注意。 19
rm, cp, mv ユニークなディレクトリパスをつける -iをつける(interactive) パスのtab補完が効く場合、1文字削ってtabキーで補完する rm -i ファイル名 …
削除確認 cp -i 元ファイル名 先ファイル名 … 上書き確認 mv -i 元ファイル名 先ファイル名 … 上書き確認 20
「id -un」「pwd」「ls -l」 で、シェル実行ユーザやカレントディレクトリ、ファイルを確認しながらやらか すリスクを減らす。 21
• crontab • hostname • shutdown, reboot • rm, cp,
mv • vi 22
vi 例えばターミナルソフトを複数起動して 本番サーバの設定とSTGサーバの設定を比べていた時 うっかり「:w」を打ってしまう可能性 23
vi viewコマンドもしくは vi -R ファイル名 R(注:大文字)オプションをつけると読み込み専用モード ただし、「:w!」で上書きが可能 状況に合わせて less [-N]
cat, head, tail more 等を使う 24