qnap/autofs をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
&color(red){未完成};
QNAPに撮影データを集めたい。自動的に。
カメラサーバがwindowsならタスクマネージャに転送スクリプト...
でもカメラサーバに余計なものを置いちゃダメとかの運用もあ...
これがLinuxマシンなら cifs でautofs and rsync で回すがで...
QNAPにはautofsがない。なのでいれてみる。
QNAPには「AppCenter」なるものがあってそこでQNAPの機能拡張...
&color(magenta){Entware};は ubuntu で言う所の dpkg な感じ...
***Entware [#f2a40f44]
[[https://www.myqnap.org/>+https://www.myqnap.org/]]に行...
#code(nonumber){{
Entware is an Optware replacement for arm5, arm7, aarch64...
Entware is used to install additional packages (ipk-packa...
}}
とあり、「Read More..」でダウンロードリストが表示される
現在使用しているQNAPのcpuチップが INTEL/AMD 系なら「TS-NA...
64bitのARM系チップ搭載QNAPなら「TS-NASARM_64」のリンクを...
ここでは「TVS-472XT」を使っているので intel/amd系の「TS-N...
その後QNAPにwebログインして「AppCenter」を立ち上げて、上...
暫くインストール作業が行われて「AppCenter」に下記アイコン...
&ref(2025y12m08d_230656936,nolink);
***opkg コマンドを使う [#a6e79e57]
次にQNAPにコマンドラインからログインします
#code(nonumber){{
ssh -l admin qnap
}}
初めにメニューが出ますが、「 Quit (return to normal shell...
一応、Entware を入れたことで実行環境は既に整えられている...
#code(nonumber){{
[~] # ls -ld /opt
lrwxrwxrwx 1 admin administrators 35 2025-12-08 22:41 /op...
[~] #
[~] # ls -l /share/CACHEDEV1_DATA/.qpkg/Entware
total 48
drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:47 b...
-rwxr-xr-x 1 admin administrators 1182 2018-03-09 15:31 E...
drwxr-xr-x 4 admin administrators 4096 2025-12-08 22:41 e...
drwxr-xr-x 2 admin administrators 4096 2025-05-23 18:17 h...
drwxr-xr-x 3 admin administrators 4096 2025-12-08 22:47 l...
drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:41 l...
drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:41 r...
drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:41 s...
drwxr-xr-x 4 admin administrators 4096 2025-05-23 18:17 s...
drwxrwxrwx 3 admin administrators 4096 2025-12-08 22:47 t...
drwxr-xr-x 4 admin administrators 4096 2025-05-23 18:17 u...
drwxr-xr-x 6 admin administrators 4096 2025-12-08 22:41 v...
[~] #
[~] # cat ~/.profile
export PS1='[\w] # '
reset
source /opt/etc/profile
[~] #
}}
こんな感じなら大丈夫で、次はokpgの操作になります
#code(nonumber){{
[~] # opkg --version
opkg version 38eccbb1fd694d4798ac1baf88f9ba83d1eac616 (20...
[~] #
[~] # opkg update ...
Downloading http://bin.entware.net/x64-k3.2/Packages.gz
Updated list of available packages in /opt/var/opkg-lists...
[~] #
}}
為にしにhtopを入れてみる
#code(nonumber){{
[~] # opkg install htop
Installing htop (3.4.1-1) to root...
Downloading http://bin.entware.net/x64-k3.2/htop_3.4.1-1_...
Configuring htop.
[~] #
[~] # opkg list-installed
entware-opt - 227000-3
entware-release - 2025.05-1
entware-upgrade - 1.0-1
findutils - 4.10.0-1
grep - 3.11-2
htop - 3.4.1-1
libc - 2.27-11
libgcc - 8.4.0-11
libncurses - 6.4-3
libncursesw - 6.4-3
libpcre2 - 10.42-1
libpthread - 2.27-11
librt - 2.27-11
libssp - 8.4.0-11
libstdcpp - 8.4.0-11
locales - 2.27-9
opkg - 2024.10.16~38eccbb1-1
terminfo - 6.4-3
zoneinfo-asia - 2025b-1
zoneinfo-core - 2025b-1
zoneinfo-europe - 2025b-1
[~] #
}}
コマンドとしては削除「opkg remove <パッケージ>」 インスト...
***autofs [#cc889c4f]
っで実際に他のストレージをautofsでmountしてみる
#code(nonumber){{
[~] # opkg install autofs
Installing autofs (5.1.9-1) to root...
Downloading http://bin.entware.net/x64-k3.2/autofs_5.1.9-...
Configuring autofs.
[~] #
[~] # ls -l /opt/etc/auto*
-rw-r--r-- 1 admin administrators 16213 2025-05-23 18:17 ...
-rw-r--r-- 1 admin administrators 1289 2025-05-23 18:17 ...
-rw-r--r-- 1 admin administrators 519 2025-05-23 18:17 ...
[~] #
}}
ここでは C マシンの /data10 をautofs でmountするようにし...
っで auto.master は
#code(nonumber){{
[~] # cat /opt/etc/auto.master
/- /opt/etc/auto.nfs --timeout=60
[~] #
}}
auto.nfsは
#code(nonumber){{
[~] # cat /opt/etc/auto.nfs
/data10 -rw c:/data10
[~] #
}}
っでautofsの起動スクリプトを用意します. ファイル名は「/op...
#code(nonumber){{
#!/bin/sh
AUTOFSD=/opt/sbin/automount
PIDFILE=/opt/var/run/autofs.pid
MAPS="/opt/etc/auto.master"
case "$1" in
start)
echo "Starting autofs..."
if [ -x $AUTOFSD ]; then
$AUTOFSD -p $PIDFILE -f -v $MAPS &
fi
;;
stop)
echo "Stopping autofs..."
if [ -f $PIDFILE ]; then
kill "$(cat $PIDFILE)"
rm -f $PIDFILE
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
}}
これに実行権を付けて実行してみます
終了行:
&color(red){未完成};
QNAPに撮影データを集めたい。自動的に。
カメラサーバがwindowsならタスクマネージャに転送スクリプト...
でもカメラサーバに余計なものを置いちゃダメとかの運用もあ...
これがLinuxマシンなら cifs でautofs and rsync で回すがで...
QNAPにはautofsがない。なのでいれてみる。
QNAPには「AppCenter」なるものがあってそこでQNAPの機能拡張...
&color(magenta){Entware};は ubuntu で言う所の dpkg な感じ...
***Entware [#f2a40f44]
[[https://www.myqnap.org/>+https://www.myqnap.org/]]に行...
#code(nonumber){{
Entware is an Optware replacement for arm5, arm7, aarch64...
Entware is used to install additional packages (ipk-packa...
}}
とあり、「Read More..」でダウンロードリストが表示される
現在使用しているQNAPのcpuチップが INTEL/AMD 系なら「TS-NA...
64bitのARM系チップ搭載QNAPなら「TS-NASARM_64」のリンクを...
ここでは「TVS-472XT」を使っているので intel/amd系の「TS-N...
その後QNAPにwebログインして「AppCenter」を立ち上げて、上...
暫くインストール作業が行われて「AppCenter」に下記アイコン...
&ref(2025y12m08d_230656936,nolink);
***opkg コマンドを使う [#a6e79e57]
次にQNAPにコマンドラインからログインします
#code(nonumber){{
ssh -l admin qnap
}}
初めにメニューが出ますが、「 Quit (return to normal shell...
一応、Entware を入れたことで実行環境は既に整えられている...
#code(nonumber){{
[~] # ls -ld /opt
lrwxrwxrwx 1 admin administrators 35 2025-12-08 22:41 /op...
[~] #
[~] # ls -l /share/CACHEDEV1_DATA/.qpkg/Entware
total 48
drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:47 b...
-rwxr-xr-x 1 admin administrators 1182 2018-03-09 15:31 E...
drwxr-xr-x 4 admin administrators 4096 2025-12-08 22:41 e...
drwxr-xr-x 2 admin administrators 4096 2025-05-23 18:17 h...
drwxr-xr-x 3 admin administrators 4096 2025-12-08 22:47 l...
drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:41 l...
drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:41 r...
drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:41 s...
drwxr-xr-x 4 admin administrators 4096 2025-05-23 18:17 s...
drwxrwxrwx 3 admin administrators 4096 2025-12-08 22:47 t...
drwxr-xr-x 4 admin administrators 4096 2025-05-23 18:17 u...
drwxr-xr-x 6 admin administrators 4096 2025-12-08 22:41 v...
[~] #
[~] # cat ~/.profile
export PS1='[\w] # '
reset
source /opt/etc/profile
[~] #
}}
こんな感じなら大丈夫で、次はokpgの操作になります
#code(nonumber){{
[~] # opkg --version
opkg version 38eccbb1fd694d4798ac1baf88f9ba83d1eac616 (20...
[~] #
[~] # opkg update ...
Downloading http://bin.entware.net/x64-k3.2/Packages.gz
Updated list of available packages in /opt/var/opkg-lists...
[~] #
}}
為にしにhtopを入れてみる
#code(nonumber){{
[~] # opkg install htop
Installing htop (3.4.1-1) to root...
Downloading http://bin.entware.net/x64-k3.2/htop_3.4.1-1_...
Configuring htop.
[~] #
[~] # opkg list-installed
entware-opt - 227000-3
entware-release - 2025.05-1
entware-upgrade - 1.0-1
findutils - 4.10.0-1
grep - 3.11-2
htop - 3.4.1-1
libc - 2.27-11
libgcc - 8.4.0-11
libncurses - 6.4-3
libncursesw - 6.4-3
libpcre2 - 10.42-1
libpthread - 2.27-11
librt - 2.27-11
libssp - 8.4.0-11
libstdcpp - 8.4.0-11
locales - 2.27-9
opkg - 2024.10.16~38eccbb1-1
terminfo - 6.4-3
zoneinfo-asia - 2025b-1
zoneinfo-core - 2025b-1
zoneinfo-europe - 2025b-1
[~] #
}}
コマンドとしては削除「opkg remove <パッケージ>」 インスト...
***autofs [#cc889c4f]
っで実際に他のストレージをautofsでmountしてみる
#code(nonumber){{
[~] # opkg install autofs
Installing autofs (5.1.9-1) to root...
Downloading http://bin.entware.net/x64-k3.2/autofs_5.1.9-...
Configuring autofs.
[~] #
[~] # ls -l /opt/etc/auto*
-rw-r--r-- 1 admin administrators 16213 2025-05-23 18:17 ...
-rw-r--r-- 1 admin administrators 1289 2025-05-23 18:17 ...
-rw-r--r-- 1 admin administrators 519 2025-05-23 18:17 ...
[~] #
}}
ここでは C マシンの /data10 をautofs でmountするようにし...
っで auto.master は
#code(nonumber){{
[~] # cat /opt/etc/auto.master
/- /opt/etc/auto.nfs --timeout=60
[~] #
}}
auto.nfsは
#code(nonumber){{
[~] # cat /opt/etc/auto.nfs
/data10 -rw c:/data10
[~] #
}}
っでautofsの起動スクリプトを用意します. ファイル名は「/op...
#code(nonumber){{
#!/bin/sh
AUTOFSD=/opt/sbin/automount
PIDFILE=/opt/var/run/autofs.pid
MAPS="/opt/etc/auto.master"
case "$1" in
start)
echo "Starting autofs..."
if [ -x $AUTOFSD ]; then
$AUTOFSD -p $PIDFILE -f -v $MAPS &
fi
;;
stop)
echo "Stopping autofs..."
if [ -f $PIDFILE ]; then
kill "$(cat $PIDFILE)"
rm -f $PIDFILE
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
}}
これに実行権を付けて実行してみます
ページ名:
1