FastHandle is fast operation tools for infrastructure configurations and tests.
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
os:linux:get:index.html [2018/01/11 00:28] kurihara |
os:linux:get:index.html [2019/02/11 00:40] (current) kurihara |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| [[: | [[: | ||
| - | ====== Get OS Conf (get.py) ====== | + | ====== Get Linux Configuration with Fabirc |
| $FHHOME/ | $FHHOME/ | ||
| Line 7: | Line 7: | ||
| \\ | \\ | ||
| - | ===== Operation ===== | + | ===== Operation |
| <sxh bash toolbar: | <sxh bash toolbar: | ||
| $ fab -l |grep get | $ fab -l |grep get | ||
| - | $ fab -H $H auth.pro | + | $ fab -H $H |
| </ | </ | ||
| + | |||
| + | |||
| + | |||
| \\ | \\ | ||
| Line 24: | Line 27: | ||
| from fabric.api import * | from fabric.api import * | ||
| from fabric.contrib import files | from fabric.contrib import files | ||
| + | from datetime import datetime | ||
| FHHOME=os.environ[" | FHHOME=os.environ[" | ||
| Line 32: | Line 36: | ||
| # | # | ||
| @task | @task | ||
| - | def get.file_remote_local(remote, | + | def file_remote_local(remote, |
| """ | """ | ||
| date = datetime.now().strftime(' | date = datetime.now().strftime(' | ||
| hostname = run(" | hostname = run(" | ||
| - | outfile = %s/ | + | outfile = "%s/ |
| | | ||
| sudo(" | sudo(" | ||
| Line 52: | Line 56: | ||
| date = datetime.now().strftime(' | date = datetime.now().strftime(' | ||
| hostname = run(" | hostname = run(" | ||
| - | outfile = %s/ | + | outfile = "%s/ |
| | | ||
| sudo(" | sudo(" | ||
| - | get("/ | + | get("/ |
| local(" | local(" | ||
| | | ||
| Line 70: | Line 74: | ||
| date = datetime.now().strftime(' | date = datetime.now().strftime(' | ||
| yearmonth = datetime.now().strftime(' | yearmonth = datetime.now().strftime(' | ||
| - | outfile = systeminfo.%s.%s" | + | outfile = "systeminfo.%s.%s" |
| - | local(" | + | local(" |
| run(" | run(" | ||
| + | run(" | ||
| - | put(" | + | put(" |
| - | sudo(" | + | sudo(" |
| - | get(" | + | get(" |
| </ | </ | ||
| Line 85: | Line 90: | ||
| |<100% 200px ->| | |<100% 200px ->| | ||
| - | | [[os: | + | | [[os:linux: |
My Sites
SNS
Copyright (c) 2025 FastHandle - IT Operations Examples All Rights Reserved.