LoginSignup
0
0

More than 5 years have passed since last update.

tftpでバックアップ

Last updated at Posted at 2017-04-20

サーバが起動中だけファイルをtftpで引き渡すスクリプト。

#!/bin/sh

HOST="192.168.1.1"
DIR="/tmp"
FILE="morimori.log"

if [ -f ${DIR}/${FILE} ]; then

ping -c 1 ${HOST} > /dev/null

if [ $? == 0 ]; then
cd ${DIR}
echo "bin
put ${FILE}
quit" | tftp ${HOST} >/dev/null 2>&1
fi

fi

サーバ側でputできるように設定しておく必要があります。

このスクリプトをnobodyのcrontabに入れたら動きませんでした。

ping: ssend socket: Operation not permitted

他のcrontabに入れました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0