Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

reboot しても初期化されてないQNAP TS-109のcrontab設定

QNAP TS-109を使って、レンタルサーバのMySQLのバックアップをとることにした。レンタルサーバ側で週に一回 MySQLの内容をダンプしてtarファイルに固めているのだが、これをNASで週一回FTPダウンロードすることにした。

簡単なシェルスクリプトを書いて、crontab に追加しておいたのだが、rebootしたあと消えてしまっているのに気がついた。

最初にとった方法は以下である。

QNAPのForumを探すとTopicが見つかった。

http://forum.qnap.com/viewtopic.php?f=35&t=2759&hilit=crontab+reboot

/etcの下はreboot時に消えてしまうようで、ここにあるように、/dev/mtdblock5 を /tmp/config にマウントし、autorun.sh にreboot時に実行したいことを記述すればよいらしい。

結局、crontab.txt というファイルを用意し、これを/var/spool/cron/crontabs/admin にappendするようにautorun.shを編集した。

だが以下の方法が正解と思われる。

よくよく調べてみると、/etc/config の下は /mnt/HDA_ROOT/.config/ へのリンクとなっており、reboot 時に消えないようになっている。

crontab については、/etc/config/crontabというファイルを編集すればよいらしい。reboot しても上記の crontab ファイルは残っている。

ただし、/etc/config/crontab は /tmp/cron/crontabs/admin にコピーされるようで、こちらも同時に直しておけばよいようだ。

ちなみに、/var/spool から /tmp へリンクが張られている。

PAGE TOP