#author("2025-12-08T15:21:54+00:00","default:sysosa","sysosa") &colro(red){未完成}; #author("2025-12-08T15:22:02+00:00","default:sysosa","sysosa") &color(red){未完成}; QNAPに撮影データを集めたい。自動的に。 カメラサーバがwindowsならタスクマネージャに転送スクリプトを置いて、10min毎に自動起動させればいいかな。 でもカメラサーバに余計なものを置いちゃダメとかの運用もある。そうなると撮影データの転送を受ける側での対処が必要。 これがLinuxマシンなら cifs でautofs and rsync で回すができるが、はて QNAP では? QNAPにはautofsがない。なのでいれてみる。 QNAPには「AppCenter」なるものがあってそこでQNAPの機能拡張が行えるが、autofsはそこにはない。っが、qnap向けの各種コマンドツールを入れられる &color(magenta){Entware}; を入れて、そこに autofs がある。 &color(magenta){Entware};は ubuntu で言う所の dpkg な感じかな。 ***Entware [#f2a40f44] [[https://www.myqnap.org/>+https://www.myqnap.org/]]に行って、Entwareで検索 #code(nonumber){{ Entware is an Optware replacement for arm5, arm7, aarch64, mips, mipsel, x86 & x64 NASes and routers. Entware is used to install additional packages (ipk-packages) for everyday command line usage…. }} とあり、「Read More..」でダウンロードリストが表示される 現在使用しているQNAPのcpuチップが INTEL/AMD 系なら「TS-NASX86」のリンクをクリックして「Entware_1.03std.qpkg」(52kb)を得る。 64bitのARM系チップ搭載QNAPなら「TS-NASARM_64」のリンクを押下してファイルを取得します。 ここでは「TVS-472XT」を使っているので intel/amd系の「TS-NASX86」リンクを押下してファイルを得た。 その後QNAPにwebログインして「AppCenter」を立ち上げて、上部バーの「インストール」から「手動でインストール」を選んで、先ほどダウンロードしたファイルを指定します。 暫くインストール作業が行われて「AppCenter」に下記アイコンが表示されます &ref(2025y12m08d_230656936,nolink); ***opkg コマンドを使う [#a6e79e57] 次にQNAPにコマンドラインからログインします #code(nonumber){{ ssh -l admin qnap }} 初めにメニューが出ますが、「 Quit (return to normal shell environment)」を選んでコマンドプロンプトを出します。 一応、Entware を入れたことで実行環境は既に整えられているかと思いますが、確認 #code(nonumber){{ [~] # ls -ld /opt lrwxrwxrwx 1 admin administrators 35 2025-12-08 22:41 /opt -> /share/CACHEDEV1_DATA/.qpkg/Entware/ [~] # [~] # ls -l /share/CACHEDEV1_DATA/.qpkg/Entware total 48 drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:47 bin/ -rwxr-xr-x 1 admin administrators 1182 2018-03-09 15:31 Entware.sh* drwxr-xr-x 4 admin administrators 4096 2025-12-08 22:41 etc/ drwxr-xr-x 2 admin administrators 4096 2025-05-23 18:17 home/ drwxr-xr-x 3 admin administrators 4096 2025-12-08 22:47 lib/ drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:41 libexec/ drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:41 root/ drwxr-xr-x 2 admin administrators 4096 2025-12-08 22:41 sbin/ drwxr-xr-x 4 admin administrators 4096 2025-05-23 18:17 share/ drwxrwxrwx 3 admin administrators 4096 2025-12-08 22:47 tmp/ drwxr-xr-x 4 admin administrators 4096 2025-05-23 18:17 usr/ drwxr-xr-x 6 admin administrators 4096 2025-12-08 22:41 var/ [~] # [~] # cat ~/.profile export PS1='[\w] # ' reset source /opt/etc/profile [~] # }} こんな感じなら大丈夫で、次はokpgの操作になります #code(nonumber){{ [~] # opkg --version opkg version 38eccbb1fd694d4798ac1baf88f9ba83d1eac616 (2024-10-16) [~] # [~] # opkg update <-- ubuntuのようにパッケージを更新 Downloading http://bin.entware.net/x64-k3.2/Packages.gz Updated list of available packages in /opt/var/opkg-lists/entware [~] # }} 為にしに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_x64-3.2.ipk 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 <パッケージ>」 インストール可能パッケージ「opkg list」 検索「opkg search <パッケージ名>」とかとか。 ***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-1_x64-3.2.ipk Configuring autofs. [~] # [~] # ls -l /opt/etc/auto* -rw-r--r-- 1 admin administrators 16213 2025-05-23 18:17 /opt/etc/autofs.conf -rw-r--r-- 1 admin administrators 1289 2025-05-23 18:17 /opt/etc/auto.master -rw-r--r-- 1 admin administrators 519 2025-05-23 18:17 /opt/etc/auto.misc [~] # }} ここでは C マシンの /data10 をautofs でmountするようにします。Cには /etc/exports らの設定は済んでます。 っで 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の起動スクリプトを用意します. ファイル名は「/opt/etc/init.d/S56autofs」として #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 }} これに実行権を付けて実行してみます