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/27 22:45] 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 |
</ | </ | ||
- | ==== Ref. Remote Shell Commands ==== | ||
- | <sxh bash toolbar: | ||
- | |||
- | </ | ||
Line 31: | 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 39: | Line 36: | ||
# | # | ||
@task | @task | ||
- | def get.file_remote_local(remote, | + | def file_remote_local(remote, |
""" | """ | ||
date = datetime.now().strftime(' | date = datetime.now().strftime(' | ||
Line 62: | Line 59: | ||
| | ||
sudo(" | sudo(" | ||
- | get("/ | + | get("/ |
local(" | local(" | ||
| | ||
Line 79: | Line 76: | ||
outfile = " | outfile = " | ||
- | local(" | + | local(" |
run(" | run(" | ||
+ | run(" | ||
- | put(" | + | put(" |
- | sudo(" | + | sudo(" |
- | get(" | + | get(" |
</ | </ | ||
Line 92: | Line 90: | ||
|<100% 200px ->| | |<100% 200px ->| | ||
- | | [[os: | + | | [[os:linux: |
My Sites
SNS
Copyright (c) 2025 FastHandle - IT Operations Examples All Rights Reserved.